rename

  • 10 Jul

    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
  • 08 Jun

    How to rename a file using its parent folder name

    How to rename a file using its parent folder name

    Q: When working with Limagito, we were wondering if you had recommendations on how to handle this scenario.

    1. We would like to transfer files from a directory lets call it E:\Orignal Location. I have two folders and files under this directory below.
      • Under E:\Orignal Location\UNIT_1_4.1.2025\history.xml
      • Under E:\Orignal Location\UNIT_2_5.1.2025\history.xml
    2. We would like to rename the history.xml to the parent folder name, highlighted above, while moving it to final file location E:\Final Location
    3. The file result we are looking for is for two files in the location  E:\Final Location:
      • UNIT_1_4.1.2025.xml
      • UNIT_2_5.1.2025.xml

    How would you recommend configuring, or is it possible to configure the renaming since the value we want to rename is the parent name, while also moving the file to a new location with Limagito.

    A: We did a test with pdf files instead of xml, but the result would be the same.

    In your case,  E:\Orignal Location\ would be the WIN Source

    Our Directory Filter setup:

    limagito file mover directory filter option

    limagito file mover directory setup

    Destination Setup:

    limagito file mover destination setup

    limagito file mover destination options

    limagito file mover Windows folder as destination

    Please uncheck ‘Create Subdir’ because all files should go to the same folder:

    limagito file mover destination file and directory options

    Enable ‘Rename Files during Copy/Move’

    limagito file mover destination file rename option

    – Add the following file renaming setup:
    RegEx:  (.*)\.(.*)
    Replacement:  %SFS.\2

    limagito file mover destination file rename setup

    – Alternative file renaming setup when you have multiple levels of subfolders:

    • %SFS:?=?: parameter option was added recently
      • %SFS:0=1:
        • 0 > start at the end of the subfolders(s) Var %SFS > %SFS = Source File Subfolder(s)
        • 1 > use the last subfolder part only
    RegEx:  (.*)\.(.*)
    Replacement:  %SFS:0=1:.\2

    limagito file mover file renaming setup

    – RunTime Log result:

    limagito file mover runtime log result

    If you need any help with this question, please let us know.

    Best Regards,

    Limagito Team

    #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team How-to Rename , ,
  • 16 Feb

    How to use parameters within the regex rename option

    How to use parameters within the regex rename option

    Q:  have a case where I’m getting several files from a folder. I’m getting the following files with my filter:

    20240212_P2.pdf

    20240213_P2.pdf

    Where 20240212 represents the date. I’m wanting the files output it to so they are consecutive pages on the same day:

    20240213_P1.pdf

    20240213_P2.pdf

    In my file rename in the destination, I know that I could do something like (20240212)_([A-Z]\d+).pdf in the regex so I can accurately match the file, but it would be really cool if I could use (%TCD:mmddyyyy)_([A-Z]\d+).pdf with the parameter being used as a literal to match on, but I know Limagito is not setup to do that. This is more of a feature request as it would make it really useful.

    Thanks for all you guys do!

    A: We added a new option in v2024.2.16.0 to allow this. This is an advanced option, so it is a bit ‘hidden’.

    • Schedule button > Advanced Tab > “Allow Params In RegEx Renaming”:

    parameters within the regex rename option

    • File rename example using parameters within the RegEx field:

    limagito file mover file renaming using regex

    If you need any help with this ‘parameters within the regex rename option’ question, please let us know.

    Best Regards,

    Limagito Team

    #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team Rename , ,
1 2 3 4
SEARCH