I have to match the contents of a directory with the attributes of a FeatureClass. The FeatureClass field contains the names (without file endings) of documents which are either .pdf or .jpg files.

I have two directories - one for PDFs and the other for JPGs. I need to match the PDF file names with the FeatureClass Attribute and if they match rename them with the PDF file ending. The ones that are not matched are then obviously JPG.

How can I create the list of files using FME2014?

  • Is FME your only option here? I can see this being done with python script. – artwork21 Aug 7 '14 at 11:47
  • Python is also an option if you have a solution - I was thinking more along the lines of the "Matcher" transformer though – Robert Buckley Aug 7 '14 at 12:05
  • What desktop GIS applications do you have (QGIS, ArcGIS, none...etc)? – artwork21 Aug 7 '14 at 15:38
  • 1
    Already done it with the "directory / path" reader...easy when you know how – Robert Buckley Aug 8 '14 at 5:04
  • 5
    Good to hear, please answer your question. – artwork21 Aug 8 '14 at 10:31

As you indicated in your comment, this can be done with a Directory and File Pathnames Reader. In the reader parameters, you can set your Path Filter to only search PDF and JPG Files as so:

enter image description here

From there, you can join the results to your features using a FeatureMerger or Matcher transformer, depending on your workflow. You may need to do some string manipulation first, however.


FilenamePartExtractor Extracts specified parts of a filename path and returns the results as string attributes.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.