I have a csv file which has columns with /n characters and also /r/n and the column is contained in quotes something like this - "This is something/r/n Something/n Anything"
Example Data (copy paste this in a notepad and save it as .csv)
Note - please use escape and enter (/r/n) after This is Description and only enter after Something I am unable to include that in this editor.) -
INC2289067,"This is Description Something Anotherthing",2020-14-07 01:14:00,2020-16-07 09:35:00,CORP - CAD L2,GIS AP PC Support,4 - Low,Solved (Permanently),FALSE,2
I have tried this code -
reader.onload = () => {
let csvData = reader.result;
let csvRecordsArray = (<string>csvData).split(/\r\n/);
}
and this is how my csvRecordsArray is split because of /r/n after "This is Description.." in 2nd column -
0: "INC2289067,\"This is Description"
1: "Something\nAnotherthing\",2020-14-07 01:14:00,2020-16-07 09:35:00,CORP - CAD L2,GIS AP PC Support,4 - Low,Solved (Permanently),FALSE,2"
Now how can i read this csv file without 3rd party libraries like NGXCSVParser without breaking my columns when there is an occurrence of /r/n or /n. NGXCSVParser does a great job but I cannot use it in my project because of compatibility issues cause we are using Angular 6. please help.