Skip to main content
Question

Exclude wildcard on reader

  • February 19, 2018
  • 4 replies
  • 48 views

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor

I have two files in a common directory with the following naming scheme

{Know prefix}_{variable suffix}

 

{Know prefix}_{known infix}_{variable suffix}

ex.

ABC_123

 

ABC_XYZ_123

Is there an easy way to read in only the file without the infix? The standard wildcard {prefix}* will pick up both files. Currently I'm testing the fme feature type to see whether or not it contains the infix, but ideally I would like to not even read it in.

4 replies

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • February 20, 2018

Heya @jdh,

 

Excellent question - Just thinking about a workaround which popped into my head, while it's inconvenient Would the PATH reader followed by FeatureReader be an option here for you?

takashi
Evangelist
  • February 20, 2018

Why not use a regular expression? (Filter Type: Regular Expression)

^[^_]+_[^_]+$

0684Q00000ArKrxQAF.png


jdh
Contributor
Forum|alt.badge.img+28
  • Author
  • Contributor
  • February 20, 2018
takashi wrote:

Why not use a regular expression? (Filter Type: Regular Expression)

^[^_]+_[^_]+$

0684Q00000ArKrxQAF.png

My understanding is the Merge Filter is applied after the dataset is read (discarding features that don't match the filter expression),  I'm looking to completely avoid reading in the data.

 

 


takashi
Evangelist
  • February 20, 2018
takashi wrote:

Why not use a regular expression? (Filter Type: Regular Expression)

^[^_]+_[^_]+$

0684Q00000ArKrxQAF.png

I think that there is no way to do that in the current FME. I would use the PATH reader, a filter transformer and a FeatureReader, as @MattAtSafe suggested.

 


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