Skip to main content
Question

Create a folder


nedwaterman
Contributor
Forum|alt.badge.img+9

Hello,

 

Really dumb question: can do I use FME workbench to create a new folder, ideally with todays date?

Will the filecopy mover just create the folder if it doesn't exist?

 

Cheers

N

4 replies

takashi
Influencer
  • May 13, 2020

Yes, the File Copy Writer will create the destination folder if it doesn't exist.


redgeographics
Celebrity
Forum|alt.badge.img+50

An alternative would be to use a Fanout on the writer

So in this case the workspace will create a folder named after the current date (yyyymmdd format) in the /Volumes/support/FME Knowledge folder. For some reason I'm getting errors when I don't include a character after that date, hence the _


bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • May 14, 2020

Yet another Alternative available for use is SystemCaller, if you prefer Command Lines, and on Windows you can call the relevant File and Folder commands and use the System date and time variables like %date% and %time.   To get an equivalent YYYYMMDD format you can use

set YYYYMMDD=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%
mkdir "C:\BaseFolder\SubFolder%YYYYMMDD%" 

However, there are more than enough Transformers in FME to create the required folder path format, so this is only for those that maybe have an existing BAT they want to copy from  to replicate system level commands inside an FME workspace


nedwaterman
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • May 14, 2020

Thank you for all your suggestions - really helpful!


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