metacatui
metacatui copied to clipboard
Use a more robust CSV parser to auto-populate the attribute editor
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
PapaParse introduced in https://github.com/NCEAS/metacatui/pull/2519. It's very lightweight, well supported, and robust. It can even be multi-threaded!