Files
casebot/lib/csv.ex
T

24 lines
482 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)
2026-08-16 19:05:05 -05:00
|> Enum.map(fn row ->
row
|> Enum.map(&String.trim/1)
|> Enum.map(&:binary.copy/1)
|> List.to_tuple()
end)
end
def init_master_data(filepath) do
raw_data = CSV.rows(filepath)
2026-08-15 23:08:36 -05:00
end
end