Module loki_csv

loki_csv - A fast and lightweight CSV parser and writer for Erlang.

Description

loki_csv - A fast and lightweight CSV parser and writer for Erlang

Data Types

csv_data()

csv_data() = [csv_row()]

csv_options()

csv_options() = #{delimiter => char(), quote_char => char(), escape_char => char(), has_header => boolean(), skip_empty_lines => boolean(), trim => boolean(), comment_char => char() | undefined}

csv_result()

csv_result() = {ok, csv_data()} | {ok, csv_data(), csv_row()} | {error, term()}

csv_row()

csv_row() = [binary()]

Function Index

parse_file/1Parse a CSV file with default options.
parse_file/2Parse a CSV file with custom options.
parse_string/1Parse a CSV string with default options.
parse_string/2Parse a CSV string with custom options.
write_file/2Write data to a CSV file with default options.
write_file/3Write data to a CSV file with custom options.
write_string/1Convert data to a CSV string with default options.
write_string/2Convert data to a CSV string with custom options.

Function Details

parse_file/1

parse_file(Filename::file:filename()) -> csv_result()

Parse a CSV file with default options

parse_file/2

parse_file(Filename::file:filename(), Options::csv_options()) -> csv_result()

Parse a CSV file with custom options

parse_string/1

parse_string(Binary::binary()) -> csv_result()

Parse a CSV string with default options

parse_string/2

parse_string(Binary::binary(), UserOptions::csv_options()) -> csv_result()

Parse a CSV string with custom options

write_file/2

write_file(Filename::file:filename(), Data::csv_data()) -> ok | {error, term()}

Write data to a CSV file with default options

write_file/3

write_file(Filename::file:filename(), Data::csv_data(), Options::csv_options()) -> ok | {error, term()}

Write data to a CSV file with custom options

write_string/1

write_string(Data::csv_data()) -> {ok, binary()} | {error, term()}

Convert data to a CSV string with default options

write_string/2

write_string(Data::csv_data(), UserOptions::csv_options()) -> {ok, binary()} | {error, term()}

Convert data to a CSV string with custom options


Generated by EDoc