Question

Directory and File Pathnames to Isolate Folders

  • 30 August 2019
  • 4 replies
  • 4 views

Anybody have any success copying over a select group of folders using the Directory and File Pathnames to a filecopy transformer? I currently have it set up the same as described in https://knowledge.safe.com/questions/62005/copy-entire-folder-from-a-to-b-destination.html

where it successfully copies ALL the folders. (path filter is currently set to *) But I would like to set a regex in the Path Filter to only grab the folders I want.

example:

I have 9 folders with sporadic numbering/naming and only want folders 01,02,03 & 09.

01 – test

02 – test

03 – test group1

04 – test group2

05 – test

11 - test

12 - test

17 - test

09 - test

I tried

01 - test\\n02 - test\\n . . . but I can't seem to skip to the 09 folder?

Any thoughts

 


4 replies

Badge +22

The readers all use glob patterns as filters, not regex.

 

 

You are better off doing something like 0* in the reader, and then a tester to keep only the ones you want, and then your fileCopy writer.
Badge +22

The readers all use glob patterns as filters, not regex.

 

 

You are better off doing something like 0* in the reader, and then a tester to keep only the ones you want, and then your fileCopy writer.

For an overview of glob see https://en.wikipedia.org/wiki/Glob_(programming)

The readers all use glob patterns as filters, not regex.

 

 

You are better off doing something like 0* in the reader, and then a tester to keep only the ones you want, and then your fileCopy writer.

Thanks JDH, worked great, is there anyway to convert the status to read-only while doing the transfer?

Badge +22

Thanks JDH, worked great, is there anyway to convert the status to read-only while doing the transfer?

Not that I am aware of with the FileCopy Writer. If you use a FeatureWriter (set to FileCopy) you can use the summary port to trigger a SystemCaller to use a command line to make them read-only after the transfer.

 

In windows that would be: attrib +R "path to folder"\\* /s /d

Reply