I have a batch of PDF files in a folder and I am trying to rename them.
Example:
File1_20170501_data.pdf
File2_20170401_statistics.pdf
Sale2_20170404_Misc.pdf
I only want to keep the first six characters of each file name (the five characters left to underscore and the underscore) and replace everything behind with sample data
.
The final file names should be:
File1_sample data.pdf
File2_sample data.pdf
Sale2_sample data.pdf
Anyone can advice which command line to use for this file renaming task?