read .txt file data with data between specific lines "string" .
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
jahanzaib ahmad
am 27 Jun. 2019
Kommentiert: Star Strider
am 27 Jun. 2019
I want to read data between ( strings ) line starting from " *Node " and
ending at and next (strings ) line " *Element, type=C3D4" .
0 Kommentare
Akzeptierte Antwort
Star Strider
am 27 Jun. 2019
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Low-Level File I/O finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!