move a string of characters

Bulk Rename Utility How-To's

move a string of characters

Postby jgt1942 » Tue May 05, 2020 6:12 pm

I've been trying to clean-up my woodworking library and now at the point where I want to move a string of characters to another location in the filename and I cannot determine how to do this. Example: I have a filename of "Woodsmith 072-12 1990 - Vol 12 Bent Lamination.pdf" where the '"-12" represents the month. I want to move it to just after the year and have "Woodsmith 072 1990-12 - Vol 12 Bent Lamination.pdf" as the name. I understand how to move/copy from the first/last x position(s) but not if the string is in the middle of the filename.
jgt1942
 
Posts: 4
Joined: Sun Feb 10, 2013 6:09 am

Re: move a string of characters

Postby therube » Tue May 05, 2020 7:00 pm

1:RegEx
Code: Select all
Match:  (.*?)(-\d\d)\s(\d\d\d\d)(.*)
Replace:  \1 \3\2\4

Match everything, up to the first (dash)(digit)(digit), followed by a (space) & four more (digits), followed by everything else.

Rearrange things, moving the Year (\d\d\d\\d) before the Month (-\d\d)...
therube
 
Posts: 1317
Joined: Mon Jan 18, 2016 6:23 pm

Re: move a string of characters

Postby jgt1942 » Tue May 05, 2020 7:49 pm

much thanks "therube"....
I will give this a shot but I did find another workaround, not near as good as your suggestion.
I used the "Import rename-pairs" (under Actions). I used the pipe and the comma for two different tests to separate the old and new name, e.g. the pipe in one test and the comma in a CSV file for the 2nd. Both worked.
I had to use two different text editors (textpad and Kedit) and excel only because I did not know how to do it all in one app. :oops:
jgt1942
 
Posts: 4
Joined: Sun Feb 10, 2013 6:09 am

Re: move a string of characters

Postby jprc » Sun Jul 19, 2020 9:57 am

Oooch...
I have the same problem, but with the age, I am less and less able to understand "expressions" and the way to customize them ...

It would be nice to have in [Move/Copy Parts (6)] a field like "String starting from" & "Ending at" for allowing to move/copy a part of the string to a starting/ending position.
Any plan for it in the future ?

Merci !
jprc
 
Posts: 1
Joined: Sun Jul 19, 2020 9:45 am


Return to How-To