MATLAB: Import text file in loop

text filetextscan

Hi, I'm creating text files from another program that I want to import into Matlab. I have been using the import wizard matlab option (see attachment), however the size of each file is different. In the function created by Matlab, I would like to know if the 'formatSpec' can be defined automatically or if I can create it for every new file?

Best Answer

Answer to automatically build 'formatSpec' using the import function created by Matlab.
A = repmat('%s',1,201);
B = '%[^\n\r]';
formatSpec = strcat(A,B);