Files
casebot/lib/csv.ex
T

19 lines
452 B
Elixir
Raw Normal View History

2026-08-15 23:08:36 -05:00
defmodule Casebot.CSV do
@doc"""
Returns a list of strings representing the CSV file. Each list
"""
def rows(path\\ "persist.csv") do
2026-08-15 23:08:36 -05:00
path
|> File.read!()
#|> String.trim()
2026-08-15 23:08:36 -05:00
|> 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)
2026-08-15 23:08:36 -05:00
end
end