I have a folder full of files, column columns on the left side of each file. Some files have Code> fgetl and for reading a line, and for the yyyymmdd dates, and others have
mm / dd / yyyy dates in I
minutebars1 () to
yyyymmdd To type, and type
minutebars2 () to
mm / dd / yyyy I tried to do this with a statement, trying to say it, That if successfully read any course with a format within the loop running through all the files, then apply the correct function, though post below A code is not working, I get an error
textscan lines Buddha as created went format string . How should this be done correctly?
% reads all file names fPath = uigetdir ('.', 'Select the directory containing the CSV files'); If fPath == 0, error ('no folder selected'), end fNames = dir (fullfile (fPath, '*. Csv')); FNames = strcat (fPath, filesep, {fNames.name}); Process of each file for% I = 1: Length (fNames) fid = fopen (fNames {i}, 'rt'); If textscan (fid, '% i,% d:% d:% * d.% * D,% f,% d,% * c') for 1 minute pot 1 (fNames {i})% minutebars1 ( ); In the end if textscan (% fid, '% d /% d /% d,% d:% d:% d,% f,% d,% * c') for% 2 minutes bars2t (fNames {i}) Minbars2 (); End fclose (fid); Read the first line as a string and check that it is in the format << code>
regexp pattern test.
No comments:
Post a Comment