dashbitco / nimble_csv

A simple and fast CSV parsing and dumping library for Elixir
https://hexdocs.pm/nimble_csv
767 stars 51 forks source link

Keep track of line numbers while parsing #41

Closed alco closed 4 years ago

alco commented 5 years ago

This allows us to include the offending line numbers in parse errors.

sourcelevel-bot[bot] commented 5 years ago

Hello, @alco! This is your first Pull Request that will be reviewed by Ebert, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

alco commented 4 years ago

I had to write a custom CSV parsing library from scratch for my company's use case. We needed to have native support for streaming with efficient reading from file, a bunch of toggles that affect what data is returned from the parser (e.g. parse only the first field of each row into a string and skip the rest) and the ability to skip malformed row and keep parsing. That is, a syntax error in one row shouldn't abort parsing the whole file.