Hi all,
I'm having some issues creating a workflow to rename pdf files. I have 75 pdf files but they're all named differently. My goal is to rename them for example:
abc - xyz
I only want abc. I tried using formulas but its not working. Fortunately all the files have a dash (-) and I wanted to have it delete every letter after including the first dash.
I tried the following: New Field: Filenameout
Regexreplace([filename], '(.)\s-.(.pdf)', '$1$2')
Another new field: Command
[directory] + "\rename " + [filename] + " " + filenameout
I tried the command tool but I'm not sure why it's not working. The PDFs are in a shared folder.
Any suggestions?
Solved! Go to Solution.
Hi @JamesJL
You can use this macro to rename files: https://community.alteryx.com/t5/Community-Gallery/Rename-files/ta-p/998942
Just build the FileNewName column with the formula tool as you wish and it will work.
Hi!
My company is strict about downloading certain things. Is there an alternative?
I actually figured it out.
Regexreplace([filename], '(.)\s-.(.pdf)', '$1$2')
then another formula tool
"Rename "+' " '+[FullPath]+' " '+" "+ ' " '+Left(Filename), Findstring([Filename], '-')) + '.pdf" '
Granted I had some help but not bad for someone that has used it the past two months right??