File Mover Blog

July 10, 2025

How to rename files and add the folder name on each file

How to rename files and add the folder name on each file?

Q: I was wondering if you could help me.

I did do quite a bit of searching over the last few days trying to find a solution, and just couldn’t get it worked out.

I have a lot of folders with PDFs in them.

The folders are named:
01-01-2025
01-02-2025

and so forth. Each folder has a number of PDFs in them, named as:

A1.pdf
A2.pdf
A3.pdf
A10.pdf

and so forth. Each folder has a number of PDFs and they are all identically named, as in letter number.pdf.

Can you help me get a set up where, if I drop a folder in a source folder, Limagito processes the and puts the folder name on each file, as in

20250102_A_0001.pdf
20250102_A_0002.pdf

and

20250102_B_0001.pdf

and

20250102_A_0010.pdf
20250102_A_0011.pdf

and so forth. This would be a move, with the files going into a folder with the same name as the original, if possible.

This would be really huge if you could help me. I probably have 15 years of folders that need to be processed, for about 20 publications.

We are trying to send a lot of archives to newspapers.com, and this is the naming convention they prefer.

If there is anything else you need from me please let me know. Thank you in advance for any help.

A: Yes this is possible using our Destination file rename option:

  • Windows Folder as Source. Root folder in our case is C:\Test\In_PDF\

limagito file mover windows folder as source

  • File Filter setup, we only want to handle pdf files in our example:

limagito file mover filename include filter

  • Directory Filter setup: we only want to handle files within subdirectories one level deep:

limagito file mover directory filter setup

  • Move Files, during the test we used Copy Files:

 

limagito file mover function setup

  • Windows folder as Destination:

limagito file mover destination setup

  • Destination Rename Files:

limagito file mover file rename setup

  • Rename Files Setup:

limagito file mover file rename setup

(.)(\d\d\d\d)\.(.*)
%SFS:7-10:%SFS:1-2:%SFS:4-5:_\1_\2.\3
CEM
(.)(\d\d\d)\.(.*)
%SFS:7-10:%SFS:1-2:%SFS:4-5:_\1_0\2.\3
CEM
(.)(\d\d)\.(.*)
%SFS:7-10:%SFS:1-2:%SFS:4-5:_\1_00\2.\3
CEM
(.)(\d)\.(.*)
%SFS:7-10:%SFS:1-2:%SFS:4-5:_\1_000\2.\3
CEM

 

  • RunTime Log Result:

limagito file mover runtime log

  • Source folders used during this test:

limagito file mover folder name on each file

limagito file mover folder name on each file

limagito file mover folder name on each file

Feedback from customer:

OMG… thank you so much. You guys are awesome.
I’ve tested it and it works perfectly.
I think this will probably help me with some other files that have single and double digit page numbers.
You have my deepest appreciation.

If you need any help with this ‘folder name on each file’ question, please let us know.

Best Regards,

Limagito Team

#regex #managedfiletransfer #filetransfer #filemanagement

By Limagito-Team Rename Share:
SEARCH