Leaving the last 9 characters of a filename in Automator

applescriptautomator

I have a ton of files to rename where we only need the last 9 characters of the file.

The files are currently named as this: FirstName_LastName_000000000.pdf.
Essentially, I want to rename the files so that they are named as such: 000000000.pdf

If somebody can assist with providing a way of doing so that will be awesome.

Best Answer

If the files are in the same folder, go to Finder and select all the files you want to rename. Then right-click on them and one of the options is to rename xxx items where xxx is the number of files selected. When you select this option it opens a panel where you can enter how you want the files renamed. Then you can select rename and all the files will be renamed.

Or from the command line use ls *.ext where ext is the extension of your file names, in your case pdf. If the ls command listed just the files you want to change the name of use cp *.ext newFileName.ext to copy the files to a new file name or use mv *.pdf NewFileName.pdfto move the files.