Stop msg per line execution

I used file in to read csv file per line:

My problem is that I want to end or break the reading after it achieved a certain condition.
Example is if it has read the value of col1="A" then stop reading the next rows.
Is this possible?

No, not possible, but you could not pass them on once you have found what you want.

I figured that would be the case. :slight_smile:
Thanks @dceejay!

@dceejay but is there a way to know if the reading of per line loop has ended?
The reason I want this is to know if I have found what I was looking for or not.

Yes. In per line mode we add a msg.parts property. At file end that includes a msg.parts.count that is the total number of lines - which is only on the last line out as we don't know the total until then.

@dceejay I found that msg.parts.count at the last record. The only problem is that if it's being passed to the CSV node then that count will disappear. So what I did was save it before the CSV node.
I also deducted the header and checked for possible empty rows in the csv file as the csv node doesn't read empty lines.

hmm yeah - if the last line of the csv is blank (which the mostly are) then yes we don't send any output and because it's the last line (with the count property) - that never gets through... hmm will need to think about it... seems like we ought to flag the fact that it's end of file somehow...

Meanwhile you can remove the last line break from the very last line - so the last line of the file has data in - and then the parts.count does get through...

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