-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass line number to Interpreter? #29
Comments
I am also looking for this feature. I would like to handle the first and last line of the import differently. |
@BillyTom I actually changed my approach a little.. I just use a custom Interpreter which keeps track of the row number. You only have to remember to reset that number when you import multiple files. With regards to the last row, I am not sure how you would know which row is the last, as this lib reads only one row at a time. |
Hi, |
@suin any news on this? I'm also looking for a way to determine what is the last line. Our use case is we basically loop through the csv and every 100 rows we flush data to the database in one INSERT. When it's on the last line, it should always flush in case there was only e.g. 99 items on the last group. |
@garygreen this repo hasn't had a commit in a year. i'd move on to another CSV parser that is actively maintained. https://github.com/thephpleague/csv is the one i now use. |
Currently the interpreter is unaware of which line number it is given. This information would be useful to log row-level issues or report on progress. Of course this can easily be implemented in a custom Interpreter, but it might be useful enough to make it part of the library.
If there is interest in this feature, I would be happy to implement it.
The text was updated successfully, but these errors were encountered: