reading data after a string
Ältere Kommentare anzeigen
Hi,
I would like to read the data below the words 'Link Results'. What i would really like to know is how to get the line number in the text file that I'm trying to read that has 'Link Results'. After I get that I know how to read the data. so my question would be how to find that number.
Thanks!
3 Kommentare
Copy/paste the whole line if the data is on the same line, or a chunk of the data if it is on multiple line, including the first line (with Link Results) and the delimiter for the end of the block. Also, is there just one block of data or are there multiple blocks?
Sergio
am 27 Okt. 2013
Cedric
am 27 Okt. 2013
And how does the table end? Is it the end of file or is there some other content afterwards?
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 27 Okt. 2013
0 Stimmen
There are no functions built into MATLAB, or to any of the operating systems that current MATLAB run on, that can tell you which line number of a file that you are positioned to. None of the operating systems supported have any inherent concept of "line number".
Therefore if you want to know which line number something is on, you need to start at the beginning of the file, read line by line, counting each as you go, until you find the pattern you are looking for.
Kategorien
Mehr zu Characters and Strings 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!