Fail switch to use different node


I run into this problem every now and then, there is a node that sometimes works and sometimes doesn't, if it doesn't I just need ot use a different node. In the current scenario I have a file reader, sometimes the file opens fine but sometimes I have to open it with an XLS reader. Yeah I know, the data outputter is inconsistent but I can't do anything about that. I want to use the file reader, and IF it fails, use the XLS reader. I have run into wanting to do this under other case scenarios before with Selenium (webpage fails to load, just try again), and other scenarios.

Any suggestions? Maybe I could try to read the file with JAVA and see if it is garbled, then use an if switch to make the workflow use XLS instead of FIle reader? Not sure how to do that but could be a nice long work around for something that could just be a node with two ports (try first port, if fails, try second port), or something like that.

Hi glenerik, I cannot fully understand your issue, but if your are trying to load the same file with the File Reader Node and then with the XLS reader in case the first one does work, I can asume that you should clean your file before loading it into the File Reader Node which means: (i) taking care of any commas or semicolons that are present in the String columns of you file because they can be considered column separators and (ii) remove any page breaks by replacing CRTL+J by nothing in excel before converting it into CSV, TXT, etc to be readable into the File Reader Node. 

If the above does not work you can check the line of your text file that is causing trouble in Notepad++ as the Knime console tells you which one could not be readed. An alternative to Notepad++ there is a software called Ultraedit that handles heavy sized text files. 

Hope it helps


Hi Mauuu5. Excel OR file reader WILL work 100% of the time, but only 1 will work. I found the try catch nodes in knime but it is broken as per the below error and bug thread.

ERROR Loop End             2:28:91:47 Active Scope End node in inactive branch not allowed.

1 Like

A post was split to a new topic: Switches to control reader nodes