Loop error - which file?

Hello all! I have a folder full of spreadsheets sent to us from various parties which we are trying to collate with a loop. It works if everything is in the same format, but of course the third parties seem to insist on changing things which cause the loop to stumble. It is not always obvious where and it gets very time-consuming to search through each individual spreadsheet to find the problem. Is there any way to get the Knime console to tell you which file caused the loop error? Thanks!

What is the text of the loop error that you currently get?

1 Like

Hi @JWebb

I think you have something like this

You can try to write the location of the current file to a CSV. If your loop crashes the last file in the CSV should be the one which makes troubles.

Greetings, Brotfahrer

2 Likes

Do you want to load them anyway and clean them later on in KNIME? If so try adjusting your end loop
BR

Hello @JWebb,

if the workflow stopped don’t you have that information (like in flow variable which holds file location/name) right away and there is no need to go through each spreadsheet?

Br,
Ivan

The only information Knime gives me is something like “Execute failed: Input table’s structure differs from reference (first iteration) table: Column 22 [Field (Number (integer))] vs. [Field(String)]” though it does not tell me which file contains the table where it is given as a number code rather than text. The best I can do currently is guess which institution records this as a number and check their files.

I have similar moments where it tells me the input files have different numbers of columns. I have spent a lot of time checking each individual one and they are all the same, so it would be useful to know which one is causing the problem, as it’s far less obvious here.

Hello @JWebb,

how does your workflow design looks like? What KNIME version are you using?

Br,
Ivan

It’s Knime 4.0.2 I think and the workflow is set up:

List files > Table Row to Variable Loop Start > Excel Reader > Loop End > Excel Writer

All I am trying to do is consolidate all of the listed files into one table. I know where the error is here when I see it (i.e. that column being a number code instead of a string), it’s just finding it. I could include a node inside the loop to change that, but I am more thinking along the lines of when I specifically can’t see or easily fix the problem. I just wondered if the console could tell me the file name of the problem, or at least its iteration number (which I assume would follow the row 0, row 1, row 2… pattern?)

Hi @JWebb,

if you open view the Variable connection output of your Table Row to Variable Loop Start Node you should be able to identify your last processed File at which the error occurs.

BR

1 Like

Ok now I feel silly because that worked perfectly and I managed to track down the file straight away! Thanks very much; that’s a quick and simple solution.

1 Like

Hello @JWebb,

glad you figured it out! It only took 5 of us to come to that :sweat_smile:

Br,
Ivan

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