Hi,
I am trying to import a CSV file, but I receive this error "java.lang.IllegalStateException: (line 76) invalid char between encapsulated token and delimiter". The CSV file has an open quotation mark but no closing quotation mark, and my separator is ‘##’. How can I get around this problem? Is it possible to insert some escape characters?
Discussion posts and replies are publicly visible
Trying to work with a malformed CSV file is a problem in general. Can you try to convince the generating party to correct this mistake?
Hi Stefan,At the moment, I have asked the person who generates the file to check it, but do you have any other solutions? I tried using the readlinesfromtextfile function, which has been deprecated. Unfortunately, it does not recognise accents and apostrophes. Do you have any other solutions?
Trying to parse any kind of malformed data is just guesswork. Doing so will create edge case where your guessing fails. Then business will make you responsible for the failures.
If this is what you want, I can provide some ideas.
Please provide me with some suggestions, and if necessary, I will also provide users with the limits of the solutions.
The plugin "Text File Utilities" provides a function to read a text file. Then you can parse the CSV line by line.
The plugin "CsvConversions" converts CSV to JSON. Then you could use the "JSON Tools" plugin to write that JSON to the DB.
Depending on the size of the file, you might get into issues with memory consumption.