Inventory CSV Import Splits Commas Inside Quoted Fields
Level 2 · node · Data · Incorrect parsing of quoted CSV fields
Scenario
A warehouse management system imports supplier inventory from CSV files. Product names can contain commas or quotation marks encoded using standard CSV quoting. Ordinary rows import correctly, but a quoted product name containing a comma shifts the quantity column or damages the product name. Trace the import service and the field parser to fix the behavior.
Requirements
The first row is the sku,name,qty header and subsequent rows represent inventory items. Unquoted commas separate fields. Commas inside double-quoted fields remain part of the field. Doubled double quotes inside quoted fields decode to one double quote. Both CRLF and LF line endings are supported. Quantity is converted to a number, and empty input returns an empty list.
Acceptance criteria
- An ordinary CSV row produces the correct SKU, name, and quantity
- A comma inside a quoted product name is preserved
- Escaped double quotes in a quoted name are decoded
- Multiple inventory rows are imported separately
- CRLF line endings are parsed correctly
- Empty CSV input returns an empty list