Extract data from ASCII text file from specific lines and columns
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi Guys,
I have a compilation of reports in an ASCII file (see the file here: http://pastebin.com/wmmB92ZC ) I want to export them to MATLAB and I know the specific location of the data in column and line.
For example, the data for parameter N1 is located at line 37&38 at column 4. The next data for N1 comes after every 53 lines, which are 90&91, 143&,144 and so on.
I did try with text scan, but there is no option to specifically tell the exact location of the data in columns and lines.
Any help would be appreciated.
Thanks.
Regards, Wan
0 Kommentare
Antworten (1)
Walter Roberson
am 18 Apr. 2012
There is an undocumented textscan() option to specify column location. Unfortunately it only works with purely numeric data.
Anyhow, use the HeaderLines parameter to indicate how many lines to skip. Use a '%*s%*s%*s%d' format to skip the fist 3 columns and read the 4th as a number.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Text Files finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!