Can't parse CSV with quoted values
Hello,
I'm trying to parse the following CSV, which looks good to me (please tell me if I'm wrong):
"Mobile","First name","Surname","Email Address","Next Case Review","Ref","Accounts Team","Job Id","Identifer" "18035551000","John","Doe","[email protected]","1001","1","TEAM_1001","JOB_0001","1" "18035551001","Jane","","[email protected]","1002","2","TEAM_1002","JOB_0002","2" "18035551002","Peter","Smith","[email protected]","1003","3","TEAM_1003","JOB_0003","3" "18035551003","Clara","White","","1004","4","TEAM_1004","JOB_0004","4" "18035551004","Stefan","Robertson","[email protected]","1005","5","TEAM_1005","JOB_0005","5" "18035551005","Millie","Watson","[email protected]","","6","TEAM_1006","JOB_0006","6" "18035551006","","Bond","[email protected]","1007","7","","JOB_0007","7" "18035551007","Robert","Simpson","[email protected]","1008","8","TEAM_1008","JOB_0008","8" "18035551008","Laura","Rivera","[email protected]","1009","9","TEAM_1009","JOB_0009","9" "18035551009","Alex","","[email protected]","1010","10","TEAM_1010","JOB_0010","10" "18035551010","Maria","Walker","[email protected]","1011","11","TEAM_1011","JOB_0011","11" "18035551011","Fred","Stuart","[email protected]","1012","12","TEAM_1012","JOB_0012","12" "18035551012","Walter","Black","[email protected]","1013","13","TEAM_1013","JOB_0013","13"
This is the code I use to parse this CSV:
readString(csvContent, { worker: true, delimiter: ',', skipEmptyLines: true, complete: (results: any) => { // Some processing logic here } });
When I do this, I get the following error: At line 13 (column 1365): Trailing quote on quoted field is malformed At line 13 (column 1365): Quoted field unterminated
This works fine if I remove all the quotes.
Any idea?
Source: mholt/PapaParse