Hi everyone. I have some trouble. I try reading from a text file and sample data is as shown
16.Mrz.14 10:12:34
16.Mrz.14 10:12:37 -01,22522E-09
16.Mrz.14 10:12:40 -00,90903E-09
16.Mrz.14 10:12:42 -00,72633E-09
16.Mrz.14 10:12:45 -00,59084E-09
16.Mrz.14 10:12:48 -00,50685E-09
16.Mrz.14 10:12:50 -00,42215E-09
16.Mrz.14 10:13:00 -00,25394E-09
16.Mrz.14 10:13:03 +9,900000E+37OADC,+1629586.578736secs,+12454976RDNG#
16.Mrz.14 10:13:22
16.Mrz.14 10:13:31 -000,1151E-09
This is the code for reading from text file
%% Open the text file.
fileID = fopen(fullPath,'r');
%% Read columns of data according to format string.
dataArray = textscan(fileID, formatSpec, 'Delimiter','', 'WhiteSpace', '', 'ReturnOnError', false);
%% Close the text file.
fclose(fileID);
I used text scan and it gives me an error. Sometimes there are also empty lines btw these lines. I want to skip these incomplete lines and missing lines.how to do it? I would be glad if someone helps me.
Best Answer