how to delimit the file in matlab?

2 views (last 30 days)
sandy
sandy on 8 Aug 2013
end hi ..I NEED to append the .run files to excel file.the data inside each .run file will be like below,
ex:
SAMPLE_20120807_1806 0 +1.122117E+1 +7.190077E+0 +1.460343E+1 +1.352402E+0 +1.116599E+1
i done appending.but in the output excel file,the above line are stored in first cell itself(1*1).its not delimited. i am stuck with this delimit for my input file. delimiting my above examples is possible in matlab? help me ..
if true
pathName = 'C:\Temp';
fileList = dir(fullfile(pathName, '*.run'));
out = fopen(fullfile(pathName, 'append.xls'), 'w');
for k = 1:numel(fileList)
s = fileread(fullfile(pathName, fileList(k).name));
fwrite(out, s, 'char');
end
fclose(out)
end
  3 Comments
sandy
sandy on 10 Aug 2013
It's a tab separated text file.
dpb
dpb on 10 Aug 2013
doc dlmwrite
NB: if you're trying to append to an existing file, be sure the fopen argument is for append or use fseek to position at end before writing or you'll overwrite the existing file content.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!