Skip to main content
Question

filter files in folder based on input


Forum|alt.badge.img

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

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • May 21, 2018

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.


takashi
Evangelist
  • May 21, 2018

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings