Reduce list of lists to a map where keys come from the first element (like csv file)

NimbleCSV is good for that.

  alias NimbleCSV.RFC4180, as: CSV
    File.read!("data/myfile.csv")
    |> CSV.parse_string()
    |> Enum.map(fn [a, b, c] -> %{a: a, b: b, c: c} end)
3 Likes