File reader fails when inside loop

Hi,
I have a workflow where file reader is inside a double loop. After completing one iteration, it moves onto the next file. (List files --> Table Row to Variable Loop Start --> File Reader) However, file reader fails to read the file with this error:

ERROR File Reader 0:357 Execute failed: For input string: “$11” In line 3 (Row0) at column #3 (‘Dollar Sales (non-projected)’).

If I load the file separately in File Reader outside of the loop, it works fine. I have inspected the file in Notepad++ and I don’t see any weird line endings or carriage returns. The only difference appears to be in the column that $11 is in, the previous file did not have $ symbol. I have set the loop end to “Allow variable column types” and “Allow changing table specifications” but still receive the error.

Due to the nature of the work I can’t share the file right now, but I’ll work on creating an example that can be reproduced. In the meantime, does anyone have any ideas as to what could be causing the error?

@Snowdid did you try using the csv reader instead? The file reader has problems if the spec of a file changes inside a loop.

Best
Mark

1 Like

Hi @snowy -

What about forcing the column in question to string type within the loop? Then deal with the inconsistency later, after the loop is complete?

2 Likes

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