read headerlines from a text file
Ältere Kommentare anzeigen
I am trying to read each parameters in the second headerline of the file:
This is my code:
File =['data3.txt'];
fid = fopen(File,'rt');
tmp = textscan(fid, repmat('%s',1,9), 1, 'delimiter','', 'headerlines',1);
meta = tmp{1};
fclose(fid);
The problem is that the string I got is a whole string with everything connected together. Is there a way I can get these parameters separately?
The spaces between two adjacent parameters could differ from file to file.
Thank you.
Akzeptierte Antwort
Weitere Antworten (3)
Walter Roberson
am 28 Apr. 2011
0 Stimmen
Leave out the 'delimiter',''
Liqing
am 28 Apr. 2011
0 Stimmen
Fangjun Jiang
am 28 Apr. 2011
0 Stimmen
What do you mean "that does not work". Type this:
[tmp{:}]'
Kategorien
Mehr zu Historical Contests finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!