Number of lines in a txt file (empty lines computed)
1 次查看(过去 30 天)
显示 更早的评论
Dear all, how i got the number of all lines in a txt file: full and empty ones
Thanks lots
0 个评论
采纳的回答
Ahmed A. Selman
2013-4-7
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!