Hi there, I am trying to concatenate several CSV files but it seems that the source files have a format problem. I manage to read the file proper format, but by clicking “Autodetect format”, which is not possible while running a loop
@mauuuuu5 If your task does not allow for a separation or correction of the delimiters you could build a workflow where the data is read as a single column and later split into the real columns. With a try/switch you could determine which is the correct one.
Complications could arise if the delimiters are sometimes used as real data, quotes etc.
You could use the switch just to produce a list of the files and then use the standard CSV or file reader to do the import.
And then there is this. But you for sure are aware of …
Hi @mauuuuu5 , not that what I’m saying will solve your issue, but since you are reading all the files from the same folder, you don’t need to use a loop. The file readers (File Reader, CSV Reader, Excel Reader, etc) have embedded feature that allows you to read multiple files in the same folder with the “Files in folder” option:
For your issue, I was not able to open your rar file (probably because my winrar is too old), but if you have some pattern in the file names that you can see for semicolon delimiters, you can apply some rules within your loop (loop would be relevant in this case). So, the approach would be:
if (filename like "some_pattern") then
delimiter = ";"
else
delimiter = ","
And you can set the column_delimiter dynamically that way, depending on the file name: