MATLAB Function Reference Previous page   Next Page
fgetl

Read line from file, discarding newline character

Syntax

Description

tline = fgetl(fid) returns the next line of the file associated with the file identifier fid. If fgetl encounters the end-of-file indicator, it returns -1. (See fopen for a complete description of fid.) fgetl is intended for use with text files only.

The returned string tline does not include the line terminator(s) with the text line. To obtain the line terminators, use fgets.

Remarks

When reading character strings from files, pass the output of fgetl to the MATLAB native2unicode function to ensure that characters display correctly:

Examples

The example reads every line of the M-file fgetl.m.

See Also

fgets


Previous page  fftw fgets Next page

© 1994-2005 The MathWorks, Inc.