필터 지우기
필터 지우기

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

조회 수: 1 (최근 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 CenterFile Exchange에서 Low-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