Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Copying and Pasting XML files to an archive folder

BobSievert
7 - Meteor

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?

3 REPLIES 3
ArtApa
Alteryx
Alteryx

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 

BobSievert
7 - Meteor

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?

ddiesel
13 - Pulsar
13 - Pulsar

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.

Capture.PNG

 

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)

 

Capture2.PNG

 

Write BAT file:

Capture4.PNG

 

 

Use the Events tab to execute BAT file after successful workflow run:

 

Capture3.PNG

 

 

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

Labels
Top Solution Authors