-
Notifications
You must be signed in to change notification settings - Fork 8
Description
There's some great stuff here! I noticed one thing that might be a problem somewhere, but probably isn't in practice:
If a (quoted) CSV cell contains embedded newlines—which unfortunately can happen, especially with web form input or something like option-return in Google Sheets—then using wc naively as in this line will return a count larger than the number of rows:
count = `wc -l < #{filepath}`.strip.to_i
It may not matter much, but it does mean that the enumerator's .size will be wrong.
Unfortunately, I don't think in general there's a good way to deal with this other than doing a first pass with the same CSV library (or equivalent parsing logic) to get the row count. But as long as size is at least as large as the number of rows, it could just be reasonable to state as a known limitation.