I have a 'for' loop that opens a series of folders and is supposed to read the .dat files in them and extract columns of data from them. It makes a large DataArray that is supposed to have a separate column for each column of data, but it's storing all of the data in a single cell.
Here is where I extract the data:
textscan(FID,'%[^\n\r]', 4, 'ReturnOnError', false); formatSpecData = '%s%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f'; % 16 columns of data
DelimData = ' '; % Delimited by tabs
DataArray = textscan(FID,formatSpecData,31,'Delimiter',DelimData, ... 'MultipleDelimsAsOne',true,'ReturnOnError',false); % The data has 31 points in it
fclose(FID); Pressure = DataArray(:,3);
FID changes with each iteration of the for loop, and I know it's not what's causing the problem. Currently, my Pressure column is all NaN, and all of the data is stored in DataArray{1,1}, which is supposedly a 31×1 cell. In reality, it's stuffed all 19 columns and 31 rows in that cell.
I've attached a sample of the files I'm using. I've tried changing the FormatSpecData for the first column to %{hh:mm:ss.sss}T to recognize the format, but I get the error message
Unable to parse the format string at position 1 ==> %{hh:mm:ss.sss}T%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f
Date formats must be of the form %T or %{...}T.
I've also tried 'D' and 'f' for the first column with no success.
Best Answer