read .txt file data with data between specific lines "string" .

4 ビュー (過去 30 日間)
jahanzaib ahmad
jahanzaib ahmad 2019 年 6 月 27 日
コメント済み: Star Strider 2019 年 6 月 27 日
I want to read data between ( strings ) line starting from " *Node " and
ending at and next (strings ) line " *Element, type=C3D4" .

採用された回答

Star Strider
Star Strider 2019 年 6 月 27 日
The textscan function using a numeric format descriptor string will automatically stop when it encounters:
*Element, type=C3D4
so this is actually a straightforward problem:
fidi = fopen('Copy_of_Job-1.txt','rt');
D = textscan(fidi, '%f%f%f%f', 'HeaderLines',9, 'Delimiter',',', 'CollectOutput',1);
fclose(fidi);
with ‘D’ being a (1418x4) double matrix.
  7 件のコメント
jahanzaib ahmad
jahanzaib ahmad 2019 年 6 月 27 日
thankyou . i got it .. . ur code works perfectly
Star Strider
Star Strider 2019 年 6 月 27 日
As always, my pleasure.
I appreciate your compliment.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLow-Level File I/O についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by