You are provided with the following CSV file content as a variable:
"Buchungstag";"Wertstellung (Valuta)";"Vorgang";"Buchungstext";"Umsatz in EUR";
"22.10.2020";"22.10.2020";"Übertrag / Überweisung";"Auftraggeber: XY Buchungstext: KD 1 RE 3000 Ref. 123/456";"18,80";
"19.10.2020";"19.10.2020";"Übertrag / Überweisung";"Auftraggeber: AB Buchungstext: KD 1 RE 3000 Ref. 123/457";"160,00";
The goal is to parse this CSV file content, but when I declare the variable, it takes only the first value because the semicolon is the divider and it gives me a syntax error for all the other content of the CSV.
var csv= "Buchungstag";"Wertstellung (Valuta)";"Vorgang";"Buchungstext";"Umsatz in EUR"; "22.10.2020";"22.10.2020";"Übertrag / Überweisung";"Auftraggeber: XY Buchungstext: KD 1 RE 3000 Ref. 123/456";"18,80"; "19.10.2020";"19.10.2020";"Übertrag / Überweisung";"Auftraggeber: AB Buchungstext: KD 1 RE 3000 Ref. 123/457";"160,00";
You can put the entire value between single quotes:
const csv = '"Buchungstag";"Wertstellung (Valuta)";"Vorgang";"Buchungstext";"Umsatz in EUR";\n
"22.10.2020";"22.10.2020";"Übertrag / Überweisung";"Auftraggeber: XY Buchungstext: KD 1 RE 3000 Ref. 123/456";"18,80";\n
"19.10.2020";"19.10.2020";"Übertrag / Überweisung";"Auftraggeber: AB Buchungstext: KD 1 RE 3000 Ref. 123/457";"160,00";\n';
(Notice the \n
s for the line breaks)