フィルターのクリア

Read an ascii file with header and some character

5 ビュー (過去 30 日間)
M.R. Ebrahimi
M.R. Ebrahimi 2021 年 11 月 12 日
コメント済み: M.R. Ebrahimi 2021 年 11 月 12 日
I have an ascii file with the following content:
Value list for Database Order SIN
X Coordinate
>SINGEOMETRYX_COORD
Y Coordinate
>SINGEOMETRYY_COORD
ENS25
>SINAMP_COMPENS25
SIN X_COORD Y_COORD ENS25
< 1| 569140.81 |3740536.75| 0.5548803|
< 2| 569198.50 |3740525.00| 0.4484698|
< 3| 569250.62 |3740519.50| 0.3651407|
< 4| 569309.38 |3740513.00| 0.3315517|
< 5| 569360.88 |3740502.25| 0.4247019|
< 6| 569389.00 |3740474.50| 0.5214419|
How can I read the data in a array without <, | and headers.
The file attached.
Thanks
  2 件のコメント
Walter Roberson
Walter Roberson 2021 年 11 月 12 日
please attach a short example file we can test with. You might need to zip and attach that if it has an unusual file extension.
M.R. Ebrahimi
M.R. Ebrahimi 2021 年 11 月 12 日
編集済み: M.R. Ebrahimi 2021 年 11 月 12 日
Thanks for your comment.
The file has attached.

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

採用された回答

KSSV
KSSV 2021 年 11 月 12 日
fid = fopen('test.txt') ;
% 1| 569140.81 |3740536.75| 0.5548803|
S = textscan(fid,'< %d| %f | %f | %f |\n','Delimiter','\n','HeaderLines',7) ;
fclose(fid) ;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by