how to delimit the file in matlab?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
dpb
2013-8-10
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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!