Documentation
¶
Overview ¶
Package csv is a require()-able host module for reading and writing CSV, the lingua franca of tabular data. It wraps Go's encoding/csv so quoting, embedded newlines, and custom delimiters all behave correctly.
API:
csv.parse(text [, opts]) -> rows csv.stringify(data [, opts]) -> text csv.read(path [, opts]) -> rows csv.write(path, data [, opts])
opts is an optional table:
header = false -- when true, the first row names the columns and each
data row is returned as a { column = value } map
delimiter = "," -- single-character field separator
numbers = false -- when true, numeric-looking cells parse to numbers
Without header, rows are returned as an array of string arrays. The row/grid <-> string conversions live in pure helpers tested in csv_test.go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCSVPreload ¶
RegisterCSVPreload installs the loader under package.preload.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.