Icon

File_​Loop_​Example

File Loop Example

This workflow shows how to use the Table Row to Variable Loop to run a workflow on all files in a directory.

Run Workflow on All Files in DirectoryUsing the KNIME Protocol, reads in the data from this workflows data repo, then for each CSV it finds, runs through the loop. Input directory is knime://knime.workflow/dataOutput files are stored in knime://knime.workflow/data/trashNOTE: Doesn't clear out data/trash, so if workflow is run multiple times it will make additional datasets in the directory Body of Loop---For each CSV file name grabbed from first node, will perform the task and writeto a new file. Iterates through file namesNode 5Read in all file names in directoryReads file from loop variableNode 17Table Row ToVariable Loop Start Variable Loop End List Files CSV Reader CSV Writer Creates UniqueFile Name Misc Workflow Tasks Run Workflow on All Files in DirectoryUsing the KNIME Protocol, reads in the data from this workflows data repo, then for each CSV it finds, runs through the loop. Input directory is knime://knime.workflow/dataOutput files are stored in knime://knime.workflow/data/trashNOTE: Doesn't clear out data/trash, so if workflow is run multiple times it will make additional datasets in the directory Body of Loop---For each CSV file name grabbed from first node, will perform the task and writeto a new file. Iterates through file namesNode 5Read in all file names in directoryReads file from loop variableNode 17Table Row ToVariable Loop Start Variable Loop End List Files CSV Reader CSV Writer Creates UniqueFile Name Misc Workflow Tasks

Nodes

Extensions

Links