Logo

0x5a.live

for different kinds of informations and explorations.

GitHub - meh/cesso: CSV handling library for Elixir.

CSV handling library for Elixir. Contribute to meh/cesso development by creating an account on GitHub.

Visit SiteGitHub - meh/cesso: CSV handling library for Elixir.

GitHub - meh/cesso: CSV handling library for Elixir.

CSV handling library for Elixir. Contribute to meh/cesso development by creating an account on GitHub.

Powered by 0x5a.live ๐Ÿ’—

cesso - CSV parser for Elixir

Simple library to parse CSV lazily, especially made to parse huge exported databases.

Examples

use Cesso

CSV.decode(~s<lol,wut>)
  |> IO.inspect # => [["lol", "wut"]]

# string columns are supported
CSV.decode(~s<lol,"wut,omg">)
  |> IO.inspect # => [["lol", "wut,omg"]]

# they can also span multiple lines
CSV.decode(~s<lol,"wut\nomg",hue>)
  |> IO.inspect # => [["lol", "wut\nomg", "hue"]]

# you can also specify a different separator
CSV.decode(~s<lol|||wut>, separator: "|||")
  |> IO.inspect # => [["lol", "wut"]]

# the first row can be used as column names
CSV.decode(~s<a,b\nlol,wut>, columns: true)
  |> IO.inspect [[{ "a", "lol" }, { "b", "wut" }]]

# otherwise you can pass the column names
CSV.decode(~s<lol,wut>, columns: ["a", "b"])
 |> IO.inspect [[{ "a", "lol" }, { "b", "wut" }]]

# you can also parse a file
CSV.decode(File.stream!("db.csv"))

Elixir Resources

are all listed below.

Resources

listed to get explored on!!

Made with โค๏ธ

to provide different kinds of informations and resources.