Effacer les filtres
Effacer les filtres

how to delimit the file in matlab?

3 vues (au cours des 30 derniers jours)
sandy
sandy le 8 Août 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 commentaires
sandy
sandy le 10 Août 2013
It's a tab separated text file.
dpb
dpb le 10 Août 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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Low-Level File I/O dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by