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

2 vues (au cours des 30 derniers jours)
jahanzaib ahmad
jahanzaib ahmad le 27 Juin 2019
Commenté : Star Strider le 27 Juin 2019
I want to read data between ( strings ) line starting from " *Node " and
ending at and next (strings ) line " *Element, type=C3D4" .

Réponse acceptée

Star Strider
Star Strider le 27 Juin 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 commentaires
jahanzaib ahmad
jahanzaib ahmad le 27 Juin 2019
thankyou . i got it .. . ur code works perfectly
Star Strider
Star Strider le 27 Juin 2019
As always, my pleasure.
I appreciate your compliment.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Import and Export dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by