Skip to content

Instantly share code, notes, and snippets.

@blardo
Created June 18, 2015 18:49
Show Gist options
  • Save blardo/acf8ee472687748d5f3b to your computer and use it in GitHub Desktop.
Save blardo/acf8ee472687748d5f3b to your computer and use it in GitHub Desktop.
defmodule Ldif do
defp select_columns(csv_row) do
Enum.slice(csv_row, 0..2)
end
defp make_ldif(usable_columns) do
usable_columns
|> Enum.sort
|> List.to_string
|> IO.inspect
end
def parse! do
File.stream!("bellhops-org.csv")
|> CSV.decode
|> Enum.map(&(select_columns(&1)))
|> make_ldif
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment