Text scan huge text file

So I have a text file like this one:
SOLUTION AT ALPHA = 0.000 DEG
I XMID YMID CURVD CP UE DUEDS
2 0.990410 -0.002254 0.009851 0.392575 -12.992179 -121.144340
3 0.989230 -0.002529 0.011062 0.378426 -13.142627 -109.923235
4 0.987462 -0.002941 0.012878 0.361882 -13.316381 -88.611258
5 0.985108 -0.003488 0.015296 0.342852 -13.513478 -75.134740
but there is not 5 lines but something between 30 and 50 lines around 25 times this patttern. I want to use "textscan" function to read this texte file and assign thoses values in a structure in the same way they are. Is this faisable? Or possible?
thanks in advance!

2 Commenti

Bob Thompson
Bob Thompson il 28 Mar 2018
Yes it is possible, and reasonable.
Walter Roberson
Walter Roberson il 28 Mar 2018
Do I understand correctly that you would have I values up to 50, after which you have another block starting with 'SOLUTION AT ALPHA' and you want to read in that data too?

Accedi per commentare.

Risposte (1)

Star Strider
Star Strider il 28 Mar 2018
Yes.
The format string would be:
'%f%f%f%f%f%f%f'
and you need to specify 'HeaderLines',3 (or however many headerlines there are).
The readtable (link) function is also an option.

Categorie

Prodotti

Richiesto:

il 28 Mar 2018

Commentato:

il 28 Mar 2018

Community Treasure Hunt

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

Start Hunting!

Translated by