From a txt file read the 4 line
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Touts Touts
el 30 de Mzo. de 2018
Respondida: Walter Roberson
el 30 de Mzo. de 2018
Sorry for this basic question, for a txt file i need to read only the 4 line, so i skip the 3 noes above
txt file
Position 1: Level 1
Position 2: Level 1
Position 1: Level 2
Position 2: Level 2
My script
fid = fopen('My.txt','r');
C = textscan(fid, '%s', 'HeaderLines', 3)
C{:}
fclose(fid);
I need to got only
Position 2: Level 2
3 comentarios
Rik
el 30 de Mzo. de 2018
No, because as far as I can tell, you have exactly the output you need. So if you want help, you need to explain what you get, and how that is different from what you want to have.
Respuesta aceptada
Walter Roberson
el 30 de Mzo. de 2018
fid = fopen('My.txt','r');
C = textscan(fid, '%s', 'HeaderLines', 3, 'WhiteSpace', '', 'Delimiter', '\n');
fclose(fid);
line4 = C{1}{1};
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Large Files and Big Data en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!