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
  • 31 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

View original
Did this help you find an answer to your question?

3 replies

jdh
Contributor
Forum|alt.badge.img+28
  • 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
jdh wrote:

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\\


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