Difference between revisions of "ParseCsvText"

 
(One intermediate revision by the same user not shown)
Line 18: Line 18:
 
[[media:Flat File Library.ana|Flat File Library.ana]]
 
[[media:Flat File Library.ana|Flat File Library.ana]]
  
(Use '''File → Add Library...''' to add this library)
+
:(Use [[File menu|File]] → '''Add Library...''' to add this library)
  
 
== Example ==
 
== Example ==
Line 30: Line 30:
 
* [[ParseDate]]
 
* [[ParseDate]]
 
* [[Parsed Expressions]]
 
* [[Parsed Expressions]]
 +
* [[Text functions]]

Latest revision as of 20:23, 24 May 2016


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))

Library

Flat File Library.ana

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

Example

For an example, see ReadCsvFile.

See Also

Comments


You are not allowed to post comments.