Skip to main content
Solved

If file1 exists send to dir A else if file2 exists send to dir B, etc

  • November 25, 2019
  • 3 replies
  • 65 views

kieranmg
Forum|alt.badge.img+3

Hi All,

Based on a folder name i want to move files from A to B in FME

So for example:

- zip file is received via httpCaller and saved to a default location

- within that downloaded zip file, i want to extract one folder & its contents (probably using systemCaller)

- The internal folder will have 1 of 5 possible names(lets say finance, sales, IT, etc)

- Its destination will depend on the the folder name

I dont think theres a transformer for this, to check if a file exists?

So i'm guessing it would be a python script of sorts to check if each of the file names exist, set an attribute based off of that result, then filter. but im useless at python, its on my 'to learn' list. Any help is appreciated!

Best answer by jdh

There's a custom transformer on the hub called FileExistenceChecker

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

jdh
Contributor
Forum|alt.badge.img+38
  • Contributor
  • Best Answer
  • November 25, 2019

There's a custom transformer on the hub called FileExistenceChecker


kieranmg
Forum|alt.badge.img+3
  • Author
  • November 26, 2019

There's a custom transformer on the hub called FileExistenceChecker

thank you!


kieranmg
Forum|alt.badge.img+3
  • Author
  • November 27, 2019

Just to add things i've noticed with FileExistenceChecker so far:

- Its case Sensitive

- You need the file extension

- It will check if a folder exists but you need the backslash at the end, e.g. \\\\server\\folder\\