metacatui icon indicating copy to clipboard operation
metacatui copied to clipboard

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

Open robyngit opened this issue 3 years ago • 1 comments

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 avatar Oct 03 '22 16:10 robyngit

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

robyngit avatar Sep 10 '24 23:09 robyngit