Module sintra_6_1_0_0-sintra.csv_decoder

Decode data in a comma-separated values format.

Functions

V:decode (data) Decode data according to the configuration.
V:config (params) Configure the process.
new (o) Create a new object.


Functions

V:decode (data)
Decode data according to the configuration.

Parameters:

  • data

Returns:

    Table (array) of lines filtered by the callback function.
V:config (params)
Configure the process.

Parameters:

  • params Table with the following entries:
    • filename String with the name of the file.
    • content String with the text to be processed (the content of the file).
    • string_delimiter String with the string delimiter (default=").
    • column_delimiter String with the column delimiter (default=;).
    • ignore_header Boolean flag indicating to ignore the first line (default=false).
    • consider_header Boolean flag indicating to consider the first line as a header containing the names of the columns (default=true).
    • ignore_homonymous_columns Boolean flag indicating to ignore the presence of multiple columns with the same name in the header (default=false).
    • columns Table (array) with the names of each column (default=nil).
    • callback Function which will be called to process each line of data, represented by a table doubly indexed: numbers and names; this function should return the corresponding value of each line to be added to the resulting array returned by :decode().
    • only_named_columns Boolean flag indicating if the table provided to the callback should be indexed only by column names.
new (o)
Create a new object.

Parameters:

  • o
generated by LDoc 1.4.6 Last updated 2024-09-26 20:37:35