I have some text files that I want to access them in MATLAB workspace. MATLAB help says that I can use
fscanf, fgetl, and textscan. I chose the last one due to the formatted text.
I wrote the below scripts:
filename = 'myFile.txt';
fid = fopen(filename);
myData = textscan(fid, '%u64 %{dd/MM/yyyy}D %{hh:mm:ss.SSS}T %f64 %f64 %u64 %f64 %f64 %f64\r\n', 'HeaderLines', 3)
fclose(fid);
but I get the error:
Error using textscan
Unable to parse the format character vector at position 21 ==> %{HH:mm:ss.SSS}T %f64 %f64 %u64 %f64 %f64 %f64
Date formats must be of the form %T or %{...}T.
The formatted texts are as:
--------------------------------------------------------------------------------------------------
Row Var1 Var2 Var3 Var4 Var5 Var6 Var7 Var8
--------------------------------------------------------------------------------------------------
1 08/04/2018 09:56:52.790 020.00 019.999570 1999690178 055.00 010.020000 000.00000
2 08/04/2018 09:56:52.821 020.00 019.999602 1999690178 055.00 010.020000 000.00000
3 08/04/2018 09:56:52.852 020.00 019.999580 1999690178 055.00 010.020000 000.00000
4 08/04/2018 09:56:52.883 020.00 019.999623 1999690179 055.00 010.020000 000.00000
5 08/04/2018 09:56:52.915 020.00 019.999548 1999690179 055.00 010.020000 000.00000
6 08/04/2018 09:56:52.946 020.00 019.999602 1999690179 055.00 010.020000 000.00000
7 08/04/2018 09:56:52.993 020.00 019.999548 1999690179 055.00 010.020000 000.00000
8 08/04/2018 09:56:53.024 020.00 019.999602 1999690179 055.00 010.020000 000.00000
9 08/04/2018 09:56:53.055 020.00 019.999548 1999690179 055.00 010.020000 000.00000
hinstead ofH. - Matt