Lua CSV parsing library.
$ sudo luarocks install lcsv
Used to get the filename from handles.
Opens a .csv file. It defaults to "r+" mode.
It will map a CSV line that is numerically indexed to its correspondant header indexes. The header table must be a map of each index to a string (the header).
Using the same tables as .mapLineToHeader
, it will turn csvl
into a numerically indexed table.
Splits a string into lines.
It will parse a single line of CSV into a table, optionally with a header.
It parses a table of CSV lines into a table, and if specified, will use the first line as header.
Reads the first line as header. If move
is set to true, it will go back to the original position, otherwise sets the cursor at the next line of the header.
It will read the next line in the file handle and parse it into a CSV line.
It reads all the file and parses it into a CSV table.
It escapes a string for use in CSV files.
It escapes all the arguments and puts them in a CSV string.
It gets a table of CSV line tables ordered like this:
{
{ "a", "b", "c"},
{ "d", "e", "f"}
}
and turns it into a CSV string like this:
a,b,c
d,e,f
Turns a CSV line table into a CSV string.
Turns a whole CSV table into a CSV string. Will remove the header keys.
Wrapper around .newCsvLine
that will write into the document.
Wrapper around .toCsvLine
that writes to the document.
Wrapper around .newCsv
that writes to the document.
Wrapper around .toCsv
that will write into the document.
This project is licensed under MIT. Cristian Muñiz (c) 2018