z_csv_parser (zotonic_core v1.0.0-rc.14)
Link to this section Summary
Functions
Check if the first row is made up of column headers. The file must have at least a name and a category column.
Parse a line into its columns, using a character a separator.
Parse CSV data with the comma separator.
Parse CSV data with a certain separator.
Scan the file (or device) and return lines with fields.
Scan the file (or device) and return lines with fields.
Link to this section Types
Link to this type
line/0
-type line() :: [binary()].
Link to this type
lines/0
-type lines() :: [line()].
Link to this type
sep/0
-type sep() :: 44 | 59 | 9.
Link to this section Functions
Link to this function
cleanup_field(L)
Link to this function
inspect_data(B0)
Link to this function
inspect_file(Filename)
-spec inspect_file(file:filename_all()) -> {ok, line(), sep()} | {error, invalid_csv_file | term()}.
Link to this function
parse_line(Line, Sep)
Link to this function
scan_data(Data)
-spec scan_data(binary()) -> lines().
Link to this function
scan_data(Data, Sep)
Link to this function
scan_lines(DeviceOrFilename)
-spec scan_lines(file:filename() | pid()) -> lines().
Link to this function
scan_lines(Filename, FieldSep)
-spec scan_lines(file:filename() | pid(), sep()) -> lines().