Skip to main content

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.

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?

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

^e^_]+_e^_]+$

0684Q00000ArKrxQAF.png


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

^e^_]+_e^_]+$

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.

 

 


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

^e^_]+_e^_]+$

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.

 


Reply