Skip to main content
Question

Using regular expressions in the Source FME Feature Store Files Parameter

  • April 12, 2013
  • 3 replies
  • 68 views

I am trying to use wildcards/regular expressions to identify multiple FFS files to read through one FFS reader in the FME workbench.  If I use something like "C:\\SomeDir\\*83.ffs", the FFS reader reads all files that end in 83.ffs in the SomeDir directory.  I can even use "C:\\SomeDir\\*8[345].ffs" to read all files that end in 83.ffs, 84.ffs, or 85.ffs.  Now I want to read all files that end in 11.ffs or 83.ffs.  When I try "C:\\SomeDir\\*(11|83).ffs", I get an error message "Invalid FFS dataset directory 'C:\\SomeDir\\*(11|83).ffs'".  I have also tried a comma, semi-colon, or space separated list of filenames to no avail.  Is this possible or do I need to create two FFS readers?

 

 

Any suggestions would be appreciated!  I'm using FME Desktop 2013 SP1.

 

 

Steve

 

 

 

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.

3 replies

takashi
Celebrity
  • April 13, 2013
Hi Steve,

 

 

I think it's impossible to use such a regular expression in the reader settings. But we can set comma-separated two or more paths in the "Dataset" text box of a reader, so you can use the following expression instead: C:\\SomeDir\\*11.ffs,C:\\SomeDir\\*83.ffs   To get this expression, you can edit "Dataset" text box directly, or do: 1) Click [+] button of the "Add Reader" dialog box to open advanced browser. 2) Add two "C:\\SomeDir" rows. 3) Change "File/Filter" column values to "*11.ffs" and "*83.ffs". 4) Click [OK] to close the browser.   Takashi

  • Author
  • April 15, 2013
Thanks for the help Takashi.  Since I am using a Python script to generate the fully pathed file name, my return value from the script needs to match the format genrated by entering the two lines in the advanced file browser dialog:

 

 

""C:\\SomeDir\\*11.ffs" "C:\\SomeDir\\*83.ffs""

 

 


david_r
Celebrity
  • April 15, 2013
Hi Steve,

 

 

consider doing the wildcard matching in your python script and then returning the complete list of files to process, without any wildcards.

 

 

You can use the module glob to do this quite easily.

 

 

David