Transform Map v1.0.3 TransformMap.Export View Source

Documentation for TransformMap Export.

Link to this section Summary

Link to this section Functions

Link to this function to_csv(data, file_name, compress \\ true, directory \\ "temp/") View Source

Convert map to CSV file.

Examples

iex> map = [%{“id” => 4179, “inserted_at” => “2018-04-25 14:13:33.469994”, “key” => “cGhpc2h4fDI5fD”, “message” => %{“schedule_id” => “127”, “target” => %{“target_domain” => “mydomain.com”} }, “type” => “email”}] …> iex> array = TransformMap.multiple_to_array(map, “|”, true, true) …> iex> {status, _full_path} = TransformMap.Export.to_csv(array, “test.csv”, true, “temp/report”) …> iex> status :ok

Compress a file.

Examples

iex> map = [%{“id” => 4179, “inserted_at” => “2018-04-25 14:13:33.469994”, “key” => “cGhpc2h4fDI5fD”, “message” => %{“schedule_id” => “127”, “target” => %{“target_domain” => “mydomain.com”} }, “type” => “email”}] …> iex> array = TransformMap.multiple_to_array(map, “|”, true, true) …> iex> {_status, full_path} = TransformMap.Export.to_csv(array, “test.csv”, false, “temp/report”) …> iex> {status, _full_path} = TransformMap.Export.to_gzip(full_path) …> iex> status :ok

Link to this function to_json(data, file_name, compress \\ true, directory \\ "temp/") View Source

Convert map to JSON file.

Examples

iex> map = [%{“id” => 4179, “inserted_at” => “2018-04-25 14:13:33.469994”, “key” => “cGhpc2h4fDI5fD”, “message” => %{“schedule_id” => “127”, “target” => %{“target_domain” => “mydomain.com”} }, “type” => “email”}] …> iex> {status, _full_path} = TransformMap.Export.to_json(map, “test.json”, true, “temp/report”) …> iex> status :ok

Link to this function to_xlsx(data, file_name, compress \\ true, directory \\ "temp/") View Source

Convert map to XLSX file.

Examples

iex> map = [%{“id” => 4179, “inserted_at” => “2018-04-25 14:13:33.469994”, “key” => “cGhpc2h4fDI5fD”, “message” => %{“schedule_id” => “127”, “target” => %{“target_domain” => “mydomain.com”} }, “type” => “email”}] …> iex> array = TransformMap.multiple_to_array(map, “|”, true, true) …> iex> {status, _full_path} = TransformMap.Export.to_xlsx(array, “test.xlsx”, true, “temp/report”) …> iex> status :ok