You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
Yes, when using quotes, remove the trailing space in each line (or at least in the last line).
When a field is enclosed in quotes, only the text in quotes is part of the field. However, if there is a space before or after the quotes, this can lead to problems.
Thanks for your feedback, however that's not the case here. Those spaces are added by the GitHub editor, but are not in the file, and the issue can be reproduced without any leading or trailing spaces. This is a screenshot of a text editor showing that there is no space at the end (the special character shown marks the new line):
I'm also attaching a CSV file that can be used to reproduce this. DataCausingError.csv
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?
The text was updated successfully, but these errors were encountered: