Hi everyone,
I have a question with run command tool and if I can get help from you guys, I will be appreciated!
I found a answer from https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Renaming-files-at-system-level/td-p/37... about how to rename a file
What I wrote in cmd is: 'ren '+[Directory]+[FileName]+' '+'PROCESS-'+[FileName] to rename the file.
However, I just realize there is space in the path so there is always an error 1 message. I've attached an example for the path,folder and file.
Path:C:\2021 Inventory\Fresh Fruit\Apple
Folder:September 2021(changed based on moth)
File: apple sale_11_08_2021.xlsx(changed based on day)
What I expect is PROCESSED-apple sale_11_08_2021.xlsx after processing.
If I can get some advice for how can I make it work, I will be appreciated!
Solved! Go to Solution.
@Bbadef if there's a space in the path or filename, you must build your expression putting the files in quotes
Ex:
ren "C:\2021 Inventory\Fresh Fruit\Apple\apple sale_11_08_2021.xlsx" "C:\2021 Inventory\Fresh Fruit\Apple\PROCESSED-apple sale_11_08_2021.xlsx"
or
'ren "'+[Directory]+[FileName]+'" '"+'PROCESS-'+[FileName]+'" '
Hi Azuc,
Thank you for your help!It works like a charm!
Hello. I am wondering if there is a way to capture the original source file name by using the directory tool, and then pulling it into the rename formula?
I was thinking the select records tool or sample first n when n=1.
Thanks.