19 lines
452 B
Elixir
19 lines
452 B
Elixir
defmodule Casebot.CSV do
|
|
|
|
@doc"""
|
|
Returns a list of strings representing the CSV file. Each list
|
|
"""
|
|
def rows(path\\ "persist.csv") do
|
|
path
|
|
|> File.read!()
|
|
#|> String.trim()
|
|
|> NimbleCSV.RFC4180.parse_string(skip_headers: false)
|
|
|> Enum.map(fn row -> Enum.map(row, &:binary.copy/1) |> List.to_tuple() end)
|
|
|> Enum.map(String.trim)
|
|
end
|
|
|
|
def init_master_data(filepath) do
|
|
raw_data = CSV.rows(filepath)
|
|
end
|
|
end
|