Skip to content

textscan

builtin · libnexusinterp/corefcn/file-io-proprietary.cc

: c = textscan (fid, format)
: c = textscan (fid, format, repeat)
: c = textscan (fid, format, param, value, …)
: c = textscan (str, …)
: [c, position] = textscan (…)

Read delimited text data into a cell array of columns.

The source is an open file fid or the text str. format describes the columns (%f %d %s %q %c %[…], with %* to skip a field); it defaults to %f. repeat limits how often the format is applied. Name/value options include "Delimiter", "Whitespace", "HeaderLines", "EndOfLine", "CommentStyle", "EmptyValue", "TreatAsEmpty", "CollectOutput", "MultipleDelimsAsOne" and "ReturnOnError".

position is the number of characters read.