number of rows text file
7 ビュー (過去 30 日間)
古いコメントを表示
I have opened a txt file using the following code , and i see that there are 1000 lines which i can access,but length or size commands dont show the number of lines extracted(as shown in the attached photo),how can i get the number of lines.
Thanks
fid=fopen('test2.txt');
g = textscan(fid,'%s','delimiter','\n');
fclose(fid)
g{1}{4:71:10000}
0 件のコメント
採用された回答
KSSV
2017 年 2 月 16 日
Try
length(g{1})
Your g will be a cell...you can access your required line n using g{1}(n)
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!