Like ddeneau, I was trying to read a CSV file that was generated the error “The CSV file format for filename is invalid”. I tried “Read CSV” and '“Read Text”, but neither function worked.
I have a workaround, but I don’t have a solution.
I discovered that if I opened the CSV file in Excel and the save it as a new CSV file, then I could read the file. Here’s why…
I compared the original CSV file to the new CSV file in Notepad (the files look identical in Excel) and I discovered the encapsulation for these files was different.
The original file looked like this:
“Field 1 has no comma”,“Field 2 has no comma”,“Field 3, has a comma”,“Field 4 has no comma”, etc.
The new file looked like this:
Field 1 has no comma,Field 2 has no comma,“Field 3, has a comma”,Field 4 has no comma, etc.
In other words, the file I could not read was encapsulating all fields in double-quotes. The file that I could read was only encapsulating fields where the value included a comma in double-quotes.
Note: Encapsulation and encoding are not the same thing! Changing the encoding is not the answer to this problem.
Does anyone know of a way for UiPath to read a CSV file where all fields are encapsulated in double-quotes?
The workaround of re-saving the files in a CSV format defeats the purpose of automating this task, so it’s not a viable workaround for me.
Incidentally, CSV files with all fields encapsulated in double-quotes are very common, so I hope UiPath has a solution (or develops a solution) for this issue.
Thank you for anyone who can provide a solution!