ParseCsvText(text, linesep, colsep)

Reads and parses tabular «text», in the format known as a CSV (for "Comma-Separated Values") format, in which data is arranged in columns on separate lines, and in which the first line contains column labels.

Normally columns are separated by commas, although the optional «colsep» parameter can be specified if a different separation string is used.

An array of text values is returned, indexed by two local indexes, Row and Field. Typically some columns may contain text, others numbers, and other dates. You must post-process the result returned from ParseCsvText using, for example, ParseDate and ParseNum to convert the text columns to numeric values. The Row index contains the column labels.

The data within a column in the file must never contain the separator strings.

To use this function with tab-delimited data, use ParseCsvText(text, colsep: Chr(9))


Flat File Library.ana

(Use FileAdd Library... to add this library)


For an example, see ReadCsvFile.

See Also


You are not allowed to post comments.