How to parse multiple folders with multiple files in them?

Hi everyone,

I have been working on knime for a while and facing this difficulty everytime. I need to apply k-means algorithm on a set of text files in different folders(News folders) and obtain the output for some comparative analysis. I have seven different folders namely Business, Defense, Entertainment and so on... with 20-30 text articles in each folder. All i can do right now is parse only one folder using Flat File Document Parser Node. 

Is there any way to parse all the folders at once so that i will get my classification output ?

(This is a part of my final year grad project. please someone help me)

Thanks in advance :)

There is a List Folder node. With the resulting table you could loop over the different folders and the contents. The  URLs you get can be manipulated via string manipulation or rule engine in case you need to remove/add e.g. filenames. This node is part of Vernalis nodes (Cheminformatics).

As a workaround, if the folders are in the same subfolder, resp. have the same naming structure, you could just make a table with the folder names. And then do the loop over the pathtable and read the filenames with the List Files node.

Examples for iteration over list files can be found in the example server and also in the Meta Nodes of the Node Repository (Iterate List of Files).

 

Hello,

if you enable the "Include sub folders" option in the List Files node dialog the node will look recursively also in all sub folders of the provided start folder. It also allows you to list only files with a particular extension e.g. csv and or file name pattern. For an exmple have a look at the reading a list of files example which you can find in the example server.

Bye

Tobias