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 件のコメント

Bob Thompson
Bob Thompson 2018 年 3 月 28 日
Yes it is possible, and reasonable.
Walter Roberson
Walter Roberson 2018 年 3 月 28 日
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?

サインインしてコメントする。

回答 (1 件)

Star Strider
Star Strider 2018 年 3 月 28 日

0 投票

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.

カテゴリ

ヘルプ センター および File Exchange で Data Import and Export についてさらに検索

製品

タグ

質問済み:

2018 年 3 月 28 日

コメント済み:

2018 年 3 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by