Forum Discussion
csv file column count parameter issue with tab / semicolon separator
- 1 year ago
Hi Goodkat ,
The question about your files and when you remove the column numbers is related with the first row of your file.
In the TAB one you have the 2025 being in the end of the line with a tabe for each of the columns. Not sure if it's visible on this image but you can check the indentation on the first line:
So it does not matter if you have the number of columns or not because there are the correct number of separators in the first line. If you delete all the tabs in the first row you will see that the final result will be a single column:
When you get to the semicolon this is not what is happening:
You can see that there is only a semicolon in the first row so it splits by 2 when you remove the column number.
In both cases if you want to make sure you have the correct number of columns you must:
- Connect to the CSV
- Select a separator that is not on the file
- Remove the top 2 rows
- Split columns by delimiter
- Promote headers
Be aware that this option will also hard code the number of columns because of the column names that will be hard coded into that specific function. You can try and write some specific function to get a dynamic number of columns based on the number of semicolon or tab or whatever other separator.
Hi Goodkat ,
I have played around with CSV with different separators and was not able to replicate that problem when removing the number of columns from the function.
Here a couple of links to some videos that maybe can give a pointer on what is happening, vbe aware that they don't add anything to the steps you created but mayvbe you can try and check if some of them give you an explanation on what is happening. In the last one you have a workaround using split to columns.
https://www.youtube.com/watch?v=ISsL0lDobT8