NCEAS / metacatui

MetacatUI: A client-side web interface for DataONE data repositories
https://nceas.github.io/metacatui
Apache License 2.0
42 stars 27 forks source link

Use a more robust CSV parser to auto-populate the attribute editor #2059

Open robyngit opened 2 years ago

robyngit commented 2 years ago

The "Fill from file" button in the attribute editor was implemented using a simple routine that reads just the start of a file and tries to find the header names. (See issue #202). A few limitations of this method that @amoeba mentioned are that:

(1) my approach does not like the presence of a UTF BOM and (2) my approach doesn't handle quoted column names with commas inside them. Both of these aren't common IME.

We should consider using a more robust CSV parser, such as PapaParse or SheetJS

robyngit commented 2 months ago

PapaParse introduced in https://github.com/NCEAS/metacatui/pull/2519. It's very lightweight, well supported, and robust. It can even be multi-threaded!