Skip to content

Instantly share code, notes, and snippets.

@epaule
Created December 9, 2022 11:48
Show Gist options
  • Save epaule/97abe1ce0185d6bf18731d92f79863ae to your computer and use it in GitHub Desktop.
Save epaule/97abe1ce0185d6bf18731d92f79863ae to your computer and use it in GitHub Desktop.
comments on CSV parsing using Elixir & Nimnble & Flow from https://www.poeticoding.com/processing-large-csv-files-with-elixir-streams/
NimbleCSV.define(MyParser, separator: ";", escape: "\"")
def load_stream file do
file
|> File.stream!()
|> Flow.from_enumerable()
|> Flow.map(&MyParser.parse_string/1)
|> Enum.count()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment