number of rows text file
6 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
KSSV
on 16 Feb 2017
Try
length(g{1})
Your g will be a cell...you can access your required line n using g{1}(n)
0 Comments
More Answers (0)
See Also
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!