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

2 次查看(过去 30 天)
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 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import and Export 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by