gocarina / gocsv

The GoCSV package aims to provide easy CSV serialization and deserialization to the golang programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: how to Skip lines that causes error?

benemohamed opened this issue · comments

Is it possible to skip rows that causes an error?
the error

❌ record on line 191048: wrong number of fields
panic: record on line 191048: wrong number of fields
goroutine 1 [running]:

I have the same question. Is there a way to do this?

I am also interested. I do not want to reject a whole file on just a single row error.

I actually created a fork of gocsv to add an additional function that allows you to handle error for each lines separately. If the library's author is okay with it, I'll create a PR for that.

8eb931f#diff-373fb23355f8ed601aa2d3c450033ccd8cf067b36ae6255cb9d2af857bf71f55