Hi,
I am using following function to import data from a .0 file(dot zero file=text file) into Matlab workspace.
Select Text File Data Using Import Tool – http://de.mathworks.com/help/matlab/import_export/import-data-interactively.html
Now I wanted to import data from N number of .0 files, so i generated a function -importfile4.m manually from Import selection.
In a separate multiplefiles.m file I wrote the following code to repeat the same for N no. of files.
numFiles = 8; startRow = 2; endRow = inf; myData = cell(1,numFiles);
for fileNum = 1:numFiles filename = sprintf('%d.0',fileNum); Data{fileNum} = importfile4(filename,startRow,endRow); end
but i am getting the following error.
>> multiplefiles Error using textscan Invalid file identifier. Use fopen to generate a valid file identifier.
Error in importfile4 (line 37) dataArray = textscan(fileID, formatSpec, endRow(1)-startRow(1)+1, 'Delimiter', delimiter, 'HeaderLines', startRow(1)-1, 'ReturnOnError', false);
Error in multiplefiles (line 15) Data{fileNum} = importfile4(filename,startRow,endRow);
Note : Files I am using looks like the following and extension is .0
file 1 name – {3BA6AFC6-DB3F-4833-AED2-C2F147172C0D}.0 file 2 name – {4D78FD28-28D4-40A6-9C1C-277969C600AA}.0
I use Windows operating system,Please help me where am I doing wrong?
Many thanks in Advance.
Best Answer