Icon

JKISeason3-8_​tark

Filtering Redundant Folder References

Level: Medium

Description: 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

Datasets: Folder Data in the KNIME Community Hub

URL: JKISeason3-8 https://www.knime.com/just-knime-it?pk_vid=f1a9625dd14a14c5171698895027e10b
URL: Dataset https://hub.knime.com/-/spaces/-/~5HAA3T665N_vR9Ga/
URL: This challenge thread https://forum.knime.com/t/solutions-to-just-knime-it-challenge-8-season-3/80877

Node 1Get parent folders(Pattern: (.+)/.+)exclude parent folderTable Reader Regex Split ReferenceRow Filter Node 1Get parent folders(Pattern: (.+)/.+)exclude parent folderTable Reader Regex Split ReferenceRow Filter

Nodes

Extensions

Links