Icon

Just KNIME It S03 _​ CH08 _​ Filtering Redundant Folder References

You are reorganizing a data warehouse in your company, working with a filesystem that creates parent folders if you give it a reference for a child folder. For example, if you ask the filesystem to create “folder1/folder2” and neither folder1 or folder2 exist, it will create both, with folder2 inside folder1, without raising an error. Given a list of folders, you want to keep only the longest unique child folders, filtering out references to parent folders that will be generated anyway for efficiency.

Here's an example of an initial list of folders:

- folder1/folder3
- folder1/folder3/folder22
- folder1/folder3/folder22/folder47

After executing your workflow, the list above should only contain a reference for folder1/folder3/folder22/folder47.

Author: Emilio Silvestri

Just KNIME It - Season3 - Challenge 08: Filtering Redundant Folder Referenceshttps://hub.knime.com/-/spaces/-/~-EFyqVySpRyHt9Xk/current-state/ JKI S03 CH 08 Results JKI S03 > challenge 08datax combine current path in loopregexMatcher combinecount matchestry combinationsstartupper: first row to xjoinlower: remaining rows to recursivefirst inport collects data from last iteration, second is passing back to the loop startinclude truefilter unique combinations Table Reader Cross Joiner String Manipulation GroupBy RecursiveLoop Start Row Splitter Recursive Loop End Rule-basedRow Filter Row Filter Just KNIME It - Season3 - Challenge 08: Filtering Redundant Folder Referenceshttps://hub.knime.com/-/spaces/-/~-EFyqVySpRyHt9Xk/current-state/ JKI S03 CH 08 Results JKI S03 > challenge 08datax combine current path in loopregexMatcher combinecount matchestry combinationsstartupper: first row to xjoinlower: remaining rows to recursivefirst inport collects data from last iteration, second is passing back to the loop startinclude truefilter unique combinations Table Reader Cross Joiner String Manipulation GroupBy RecursiveLoop Start Row Splitter Recursive Loop End Rule-basedRow Filter Row Filter

Nodes

Extensions

Links