I was performing filtration over data and saving output in different folder but somehow I lost my workflow, filtration is done over half of the files. Now I want to compare the files already exist in output folder and ignore them before running the filtration workflow.
You can use the
List Files/Folders node to list the files in the output folder and the Reference Row Filter node to filter file names if there is list you are reading from.
You may need the
String Manipulation node as well to extract the file names. For example, the below expression extracts the file name from the path without the parent folder(s) and the file extension in the name.
regexReplace($Path$, ".*\\\\(.+?)\\..+", "$1")
C:\partent\my-file.xlsx >>> my-file
@piyushtaragi in addition to @armingrudd hints you might want to check these examples how to deal with paths and folders
@HeatherPikairos OK I think I know what is going on. The Transfer Files node would not copy the whole structure but would try to put all the single files into the same (top) traget folder - which will result in unwanted structures.
To solve this one would have to use absolute paths (otherwise the List/Files node would ‘recognize’ the workflows and not include them and their files it seems) to scan all files and folders and then replace the original (source) path part with the target path part … …
@Perciliano you can list the files you want and extract the file names and extensions and then name a single target folder and construct new paths for all files and then transfer them.
You would have to decide what should happen if there are duplicates or files with the same name:
kn_example_transfer_files_flat_from_sub_folders.knwf (191.8 KB)
in case you are wondering. You can also move whole folder structures to new places and keep the sub-folder structure like in this…
@VJAM the creation of Flow Variables for Paths is maybe not 100% straightforward. Maybe this example might help to sort it out. The “path_values” is maybe not perfectly named. I think this is constructed that you could pass several Folder variables as collection strings.
Also: CHunk Loop Start might have to be set to 1. Often I prefer the Table Row to Variable Loop Start node.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.