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.
Solved! Go to Solution.
If you are using a field such as [filename] to dynamically change the filename and sheetname of a file, use the option Change entire file path.
Of course, you have to then include the whole path in [filename].
You could also bring through the fullpath from the Input Data tool and use a formula tool to replace the date part of it, as shown:
This process doesn't rename the file, it creates a new file with a new name. The old file will still be there. It you want to actually rename the file, you'll have to use the Run Command Tool to execute a DOS command.
So we can't replace an existing file having the same keyword(the static part in the file name)?
It will only replace the file if you overwrite it using exactly the same filename, but since you're changing the filename by inserting the current data, a new file will be created and the old one will still be there.
Understood. Thanks.
By the way, can i check with you that only the latest file should be kept, deleting the old file?
Sorry for the question(might be a silly one). But i am a beginner in Aletryx. Got my first assignment, so just exploring and asking questions.
So basically i am already inputting that file. So again when i will connect the same node to an output and to an Dos command. How alteryx will analyze, that first it has to write those records in a new file and then run it.
So, then you can stick with the 1st suggestion.
It doesn't really matter if the new file is written before the old one is deleted, as long as the data is loaded by the input data tool. Once the data is in the workflow, it will be written to the new file unless there is an error in the workflow that prevents it from completing.