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.
- 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
- 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
- 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
Destination Setup:
Please uncheck ‘Create Subdir’ because all files should go to the same folder:
Enable ‘Rename Files during Copy/Move’
– 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
- %SFS:0=1:
– RunTime Log result:
If you need any help with this question, please let us know.
Best Regards,
Limagito Team
#managedfiletransfer #filetransfer #filemanagement