-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Defining delimiter inside CSV files to import #111
Comments
If we add this option it should be per file rather than global IMO. The solution suggested in this issue description would mean that the provided delimiter would be used for all files listed in the array, I suspect this would become an issue when there are a mix of comma-delimited and other-delimited files in the list. As the
Also worth considering are the other parser options here, I could see someone asking to be able to modify some of the other rules at a later date, this string prefix method doesn't scale well in that regard. Additionally, I don't recall if we support compressed files such as An alternative would be to change the type of the Finally one option is to simply say that this library only supports commas, document that and expect users to format shift their data to meet those requirements. |
Also worth mentioning the We could simply wait for that to land and avoid introducing any changes to |
My preference would be to wait for the linked PR to land and then enabling the auto-discover option. |
Following the #110 issue i could import my dataset successfully, using the default comma delimiter.
But several thousands of records could not be indexed because they contain commas inside some of their fields.
In order to have a correct result, it seems that to be able to choose an arbitrary character as delimiter is the solution.
Attempted Solutions
I tried to change my initial csv file delimiter from ";" to ",", and the import job could reach its end.
Proposal
One idea would be to allow the definition of a chosen delimiter inside the pelias.json conf file:
This character would be used as a value for the delimiter attribute of the csv-parser instance: https://csv.js.org/parse/options/delimiter/
To apply this configuration for all the csv files to import seems ok by my point of view.
References
#110
Thanks!
The text was updated successfully, but these errors were encountered: