Omiting errors while file reading

I got problem reading csv file. In integer fields  I got chars in hundreds of lines. How to omit errors like: "Execute failed: For input string: "�" In line 2306 (Row2304) at column #2" to finish execution of the task ( deleting lines with chars in intiger fields ).  I can not find such a functionality. Thank You! 

1 Like

What  node are you using to read the file?

I just tried with the CSV Reader and with the File Reader, reading the file

Name,Value

John,1

Alfred,a

Joanne,3

This is returned as 

name value
John 1
Alfred ?
Joanne 3

Both returned without error, with the value "a" in the second row  replaced as a missing vallue (displayed as ?).

 

Sounds like you have a column where the first lines are only numbers thus Knime assumes it just that, but in later llines you also have text.

You can either have the source file with " " quotes around the text, so it will be recognized as text (which perhaps is not possible for you?).

Alt use as suggested File-Reader, alt. Line-Reader, they are less picky.

 

Thank You. I Was using File reader because it automaticly recognises column type ( text, int, double etc. ) and scan the file . But when I used CSV Reader there is no error as David Ko has said.

With File reader there is error in my case. Strange.

Now in CSV Reader I got: "Encountered duplicate row ID" . How to ommit errors and delete rows with errors? Please help :) 

Deactivate the Box Has Row Header

(From the Node Description:

Has Row Header
Select this box if the first column contains row name headers (no duplicates allowed). ) 
3 Likes

Thx, it worked! :) 

1 Like

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