Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

How to replace an existing file and rename it dynamically

nazuk
8 - Asteroid

Hello All,

 

So here i having 4 files in a directory. So one of the file name is Outstanding_TSE082QT_07-06-2020_4565. So i am following a business rules to prepare a data . So the final output needs to be overwrite in Outstanding_TSE082QT_07-06-2020_4565 where 07-06-2020_4565 need to be replaced by today's date,month,year and time. 

 

I have attached my simplified task.

 

Please suggest.

 
 
 
 
 

 

14 REPLIES 14
nazuk
8 - Asteroid

Hello David,

 

I was trying this solution today i my workflow. The problem now is it has deleted all the files which are starting from TSEQ, but i want to delete the old file not the newly created.

 

DavidP
17 - Castor
17 - Castor

I looked at the workflow I posted previously.

 

1. for some reason I had Option 4 search subdir checked in the Input Data tool - that should be unchecked.

2. I have now added a unique tool before the Run Command tool to ensure that command is not run multiple times.

 

When you adapt and run the workflow, disconnect it from the Run Command Tool first and make sure that the DOS Command that is generated for the Run Command Tool (the [Cmd] field, will do what you want it to do.

mkankaria
6 - Meteoroid

I tried this solution and get a file with todays date successfully however the new file only contains the sheet I picked in the input selector (original file is a macro enabled file with multiple sheets in the workbook) and loses all the other sheets and existing formatting as well. Any suggestions?  

DavidP
17 - Castor
17 - Castor

Hi @mkankaria 

 

Can you please start a new Community conversation describing what you're trying to do. Feel free to reference this post and if you tag me with @DavidP I'll get a notification and can hopefully help you or if someone else gets there before me.

hsusilo03
5 - Atom

Hi David,

i try but run command error return code 1

 

Untitled.png

Labels