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

1 vue (au cours des 30 derniers jours)
Lila wagou
Lila wagou le 7 Avr 2013
Dear all, how i got the number of all lines in a txt file: full and empty ones
Thanks lots

Réponse acceptée

Ahmed A. Selman
Ahmed A. Selman le 7 Avr 2013
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.
  1 commentaire
Lila wagou
Lila wagou le 7 Avr 2013
Yah it is perfect, Thanks lots Mr Selman

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by