Question

filter files in folder based on input


Badge

Hello,

I have as an input parameter a list of ids separated by "|".

For example: 1|2|4

Next I have a directory with some zip files:

1.zip, 2.zip, 3,zip., 4,zip, 5,zip

As a result I would like to get only files which have names that are in the input list and have it all zipped to the result.zip file:

result.zip

 

---

 

|

 

|_1.zip

|_2.zip

|_4.zip

I came to the point where I used attribute splitter and I have a list of those Ids but I have no idea what to do next. Can you please help me with that?

Thanks!


2 replies

Userlevel 2
Badge +16

I would take this approach:

Unpack parameter: AttributeSplitter

Create features from list: ListExploder

Create filenames: StringConcatenator

Copy files to different location: SystemCaller (Copy command).

Zip files: SystemCaller (Zip command).

Hope this helps.

Userlevel 2
Badge +17

Hi @witos, the Directory and File Pathnames (PATH) reader and the File Copy writer might help you. For example, assuming the filter string (pipe-separated target file names) is given via a user parameter called "FILTER":

See these links to learn about the Path Filter parameter configuration.

Reply