How to read string/numeric line from file, and parse out one number?
Mostrar comentarios más antiguos
I can grab a specific line from a file, and store it. But however it's stored, I don't know how to pull out the 6th "value", and then use it as a number. Here's the file line:
259 FxR1 757.6469 17.6892 704.9626 820.0703 115.1077 kN
Here's how I pull and store:
fid2=fopen('file.txt');
C=textscan(fid2, '%s', 1, 'delimiter', '\n', 'headerlines', 463-1); %get one specific line
disp(C)
fclose(fid2);
Want to get the 820.0703 value out, and use that.
Thanks in advance.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre String Parsing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!