I receive 12-xml files on a daily basis. I would like to create an Alteryx Workflow that will take the daily xml files, append today's date and save the xml files to an Archive folder. Does anyone have a suggestion on how to create such a workflow?
Hi @BobSievert - You would like to append the date to the file name, right? In this case I'd use a Run Command tool: https://help.alteryx.com/current/RunCommand.htm
Thanks, Does anyone have an example workflow using the run command to copy files to a new folder while appending today's date to the file name of the copied files?
Hi @BobSievert!
There are many ways to do this. Through much trial and error, here's my go-to method for renaming files within Alteryx.
First write your XML files. Use a Block Until Done to execute the next steps after the XML files have been written to the desired location.
Example formula for RENAME command:
'RENAME '+ '"'+[FullPath]+ '"'+ ' ' + + '"'+[FileName]+"_"+DateTimeFormat(DateTimeStart(),"%Y-%m-%d")+".txt"+ '"'
Use Summarize to Concatenate Command (use \n new line as separator)
Write BAT file:
Use the Events tab to execute BAT file after successful workflow run:
RENAME "C:\Temp\Sample1.txt" "Sample1_2022-06-22.txt"
RENAME "C:\Temp\Sample2.txt" "Sample2_2022-06-22.txt"
RENAME "C:\Temp\Sample3.txt" "Sample3_2022-06-22.txt"
Let us know if this helps!
Thanks,
Deb