How to read a certain part of data from a very complicated text file containing many empty lines
古いコメントを表示
Hi, the text file includes several data structures, delimited by empty lines, like the following: -----------------------------------------
Empty line...
Empty line...
X Y Z
0.2 0.3 0.4
0.2 0.3 0.4
0.2 0.3 0.4
Three Empty lines...
A B C D E F G
Empty line...
0.1 0.2 0.3 0.4 0.5 0.6 0.7
Four Empty lines...
F R I S T G R O U P L O A D I N G
Empty line...
YY YY*C
-0.9 0.154
-0.8 0.023
-0.7 0.087
-0.6 0.098
Empty lines... Other complicated data forms...
-------------------------------------------------
I need only the YY YY*C part, to read the data into a matrix. I've tried textscan and fgetl, neither work since textscan only read one type of data structure,the data format I want is not very distinct from others; and fgetl tend to take empty lines as end of file marker, so it stops at empty lines.
Does anyone has any idea? Thanks a lot since this is very difficult for me to figure it out!
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Text Files についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!