Skip to main content
Question

Directory and File Pathnames to Isolate Folders

  • August 30, 2019
  • 4 replies
  • 23 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

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

jdh
Contributor
Forum|alt.badge.img+40
  • Contributor
  • August 30, 2019

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.

jdh
Contributor
Forum|alt.badge.img+40
  • Contributor
  • August 30, 2019

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)


  • Author
  • August 30, 2019

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?


jdh
Contributor
Forum|alt.badge.img+40
  • Contributor
  • August 30, 2019

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