how check the data type in file reader and add the odd one to new column

Hi @bheemlan,
You want to use the Column Splitter node:


You can configure it to split via the datatype.

best,
Gabriel

1 Like


here is my data i want the bad data type to marked as failed in the new column.

pls help

Or you can use a rule engine and a regular expression:

In case you want to be more strict:

5 Likes

thank you Aswin. i tried the second one but the issue here if you 2 rules ( col1,col2) then it is not giving correct output
it is working only one rule(col1) i mean one column. how do we check for the all the columns?

Ah yes, I think I made a mistake in the second example. How about this:

1 Like

Hi!

There is Column List Loop Start node. That is good approach as long as you do not have 10.000+ columns…

You may have to play with column names inside loo though :wink:

Br,
Ivan

Thank you Aswin, can u share the pattern to check alphanumeric for column ?

thank you ivan

I think that would be [0-9a-zA-Z]

1 Like

thank you aswin. i tried to alphanumeric with any special character, below pattern but it s not working

“(?i)^([[a-z][^a-z0-9\s\(\)\[\]\{\}\\^\$\|\?\\+\.\<\>\-\=\!\_]])$”

There’s also \p{Graph}

That represents all visible characters.

1 Like

Aswin, i m trying to validate integer data types for columns but it seems matches does not work here. may i know which operation i can use it here?

Apparently during import KNIME converted column Col0 to integers (=whole numbers). “MATCHES” only works on text columns (strings).

1 Like

thanks a Lot Aswin. could you please share your email id to reach out if any clarifications in future?

This forum is far better than email; when I am too busy there are many other people who may be able to help.

Thanks Aswin.

I am novice to Knime and i may be asking basic qns. here is my another requirement
im expecting only 10 columns in my input files. if file has more than 10 columns then i need to filter the additional columns to new table and use it only 10 columns.
i can filter it manually but how do i automate it ? when ever new file comes it has to pick only 10 columns and run the flow.

This node could help.

7 posts were split to a new topic: Test Column Datatype Inside Loop

Hi @mlauber71 …Thanks for the effort …If I use a column filter node based on type selection …I am not able to handle Date fields ( datatype for Date fields in my Dataset is Date cell and this type selection will filter values of Date & Time) …Are you aware of any conversion that converts Datecell to Date and Time format in type selection option of Column filter…All other Datatypes can be easily handled as per type selection suggested by you.