Pathway to occurences in different files

Dear contributors,

It is probably simple but I can't find the nodes to do that.

My need is as follow: I have a document containing a list of files (.txt). Each test file contains 2 coulumns x and y. In y there is only 2 values: 0 and 255 while x is an integer from 0 to 800 . I would like to develop a workflow that can tell me how much is the occurence of 255 in each text file.

Something like: list file --> extract x and y in each text file --> calculate 255 occurence --> get a table where in the first coloumn we have the name of the text file and in the second colomun the occurence number.

Thank you for your help,


Hi Chakib,

what you need to do is the following.

First use a list file node to get the list of files.

than use the table row to variable loop start node 

this will generate a variable which you can feed into the csv reader for reading one file in each iteration.

Than the counting is done e.g. with the groupby node.

Afterwards you might want to add the file name using the Variable to Table column node.

Last, end the loop with a loop end node.

You might want to first see our video series about looping, which is listed here. 

Best regards, Iris