Question

Create a folder

  • 13 May 2020
  • 4 replies
  • 110 views

Badge +3

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

Userlevel 2
Badge +17

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

Userlevel 4
Badge +25

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 _

Badge +3

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

Badge +3

Thank you for all your suggestions - really helpful!

Reply