Using fgetl() to read lines

17 views (last 30 days)
ZK on 10 Jan 2013
How can I choose different line to read instead first line, using fgetl() formula?
Thank you.

Accepted Answer

Amith Kamath
Amith Kamath on 10 Jan 2013 may be of some help. Unless you are constrained to using fgetl() for some reason,
C = textscan(fid, '%s','delimiter', '\n');
% Setup the line number in LineNum,
should do the trick.
ZK on 11 Jan 2013
Edited: ZK on 11 Jan 2013
Thank You I will remember that.

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 10 Jan 2013
There is no method at the operating system level to position by line. The operating system itself uses fgetl() (or fgets()) to move forward by lines. MATLAB does not provide any "wrapper" over fgetl() to support skipping lines.


Find more on Characters and Strings 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!