Number of lines in a txt file (empty lines computed)

 Respuesta aceptada

Check this out:
E=textread('Your_File.txt','%s', 'delimiter', '\n');
% reads strings, white-space or delimiter-separated. Delete %s and use %d for
% numbers, %c for char, or %u for integers.
[a,b]=size(E);
% a has the number of lines, even empty ones.

Más respuestas (0)

Categorías

Más información sobre MATLAB Report Generator en Centro de ayuda y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by