wfgilman

wfgilman

Help defining NimbleCSV

I can’t figure out the right definition to parse this string using NimbleCSV.define/2. Everything I try results in an empty list. Can anyone help?

“agency_id\tagency_name\tagency_url\tagency_timezone\tagency_lang\rBART\tBay Area Rapid Transit\thttp://www.bart.gov\tAmerica/Los_Angeles\ten”

Marked As Solved

voughtdq

voughtdq

What have you tried so far? It works for me:

NimbleCSV.define(MyParser, separator: "\t", newlines: ["\r", "\r\n", "\n"])

Then in iex:

MyParser.parse_string("agency_id\tagency_name\tagency_url\tagency_timezone\tagency_lang\rBART\tBay Area Rapid Transit\thttp://www.bart.gov\tAmerica/Los_Angeles\ten")
[
  ["BART", "Bay Area Rapid Transit", "http://www.bart.gov",
   "America/Los_Angeles", "en"]
]

Last Post!

wfgilman

wfgilman

That worked! Thank you!

Where Next?

Popular in Questions Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36689 110
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31525 112
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement