Transform Map v1.0.3 TransformMap.Export View Source
Documentation for TransformMap Export.
Link to this section Summary
Link to this section Functions
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
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
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