Import a spreadsheet
Real files are messier than your test file.
Let users import <records> from a CSV. Expected columns: <list>. Handle what real files actually contain: - Different encodings, including UTF-8 with a BOM. Excel emits these. - Columns in a different order, with different capitalisation, with trailing spaces in the headers. - Quoted fields containing commas and newlines. - Empty rows, and a trailing empty line. - Dates in several formats, and numbers with thousands separators or a currency symbol. Flow: - Validate everything BEFORE writing anything, and show a preview with per-row errors. - All-or-nothing, or skip-bad-rows? Recommend one and let me choose. - A downloadable report of what was skipped and why.
Validate the whole file before writing a single row. A half-completed import that failed on row 400 is a much worse problem than a rejected file.