How to find the positions of a string which occurs multiple times
Info
This question is closed. Reopen it to edit or answer.
Show older comments
I have a file which contains many scans,and for each scan there is the following line "par 1 f1:'Amplitude ' 1.270660e-001 3.178370e-003 0" I wish to find and extract the data contained in this line everytime it appears.
4 Comments
Jan
on 30 Sep 2011
Why? If it is exactly this line, you can parse it once manually. Or is there any additional information?
Please explain the file format more explicitely: Is it a text file? ASCII or Unicode? Are the lines separated?
David
on 30 Sep 2011
Jan
on 30 Sep 2011
Fine. Can you post what you have done so far and explain, where the problems occurred?
David
on 30 Sep 2011
Answers (2)
Grzegorz Knor
on 30 Sep 2011
doc fopen
doc fgetl
doc strfind
doc strcmpi
Fangjun Jiang
on 30 Sep 2011
0 votes
use textscan(), you may also need to use fopen(), fclose().
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!