LOADTXT Load ascii text file into numeric or cell arrays

Usage: >> array = loadtxt( filename, 'key', 'val' ...);

Inputs:
filename   
name of the input file Optional inputs
'skipline'   
number of lines to skip {default:0}. If this number is negative the program will only skip non-empty lines (can be usefull for files transmitted from one platform to an other, as CR may be inserted at every lines).
'convert'   
'on' standard text conversion, see note 1 'off' no conversion, considers text only 'force' force conversion, NaN are returned for non-numeric inputs {default:'on'}
'delim'   
ascii character for delimiters. {default:[9 32] i.e space and tab}. It is also possible to enter strings, Ex: [9 ' ' ','].
'verbose'   
['on'|'off'] {default:'on'}
'nlines'   
[integer] number of lines to read {default: all file}

Outputs:
array   
cell array. If the option 'force' is given, the function retrun a numeric array.

Notes: 1) Since it uses cell arrays, the function can handle text input.
The function reads each token and then try to convert it to a
number. If the conversion is unsucessfull, the string itself
is included in the array.
2) The function adds empty entries for rows that contains
fewer columns than others.

Author: Arnaud Delorme, CNL / Salk Institute, 29 March 2002

See the matlab file loadtxt.m (may require other functions)

Back to functions