Stop CSV Reader from column type auto detection

Dear KNIME community,

I’m in a little trouble with the CSV reader.
I have a perfectly functioning workflow which I update monthly. Now I overwrote the input files (csv, exact same thing as last month just a couple of additional rows), and the CSV reader shows a couple of errors that I guess are related to the fact that it tries to autodetect the column type again.

Is there some way I can stop KNIME from doing that? I want it to be strings in the beginning and then change the type after replacing some strings and doing other transformations later.

Thanks in advance!

You’ll need to use File Reader instead. It allows to pick header and assign its type.

3 Likes

You additionally could use R’s readr to force all columns to string

Another possibility would be to read the data with the “Fixed Width File Reader” including the column names forcing all columns to be read as strings (you would have to set a width large enough to cover your data), split the cells by the delimiter.

Later you could reuse the first line and insert the column headers again. I think something like this has been discussed before:

1 Like

OK here is a way to force KNIME to handle CSV all columns as strings (and maybe convert some of them later. Mainly it relies on the quotes and on the column names that would force the whole column to be read as string:

Column names will later be inserted separately.

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.