#1 : 16/03-25 11:58 SunsetChill
Posts: 3
|
I have a lot of files that have added text before the unique file name which has two variables in length.
Example Mosaic-Removed ABC-123 Mosaic-Removed ABCD-123 I want to move the Mosaic-Removed part to after the last number so it's formatted ABC-123 Mosaic-Removed ABCD-123 Mosaic-Removed Any help is appreciated! ~Chill |
#2 : 16/03-25 12:45 Miguel
Posts: 181
|
Reply to #1:
Hi Sunset. You can use a Replace method and a regular expression. REPLACE: (\w.+) (\w.+) REPLACE WITH: $2 $1 Ocurrence: All Use regular expression checked Best Miguel |
#3 : 16/03-25 12:54 SunsetChill
Posts: 3
|
Reply to #2:
Thanks for the quick reply. Am I using your statements as-is or modifying any of the variables? |
#4 : 16/03-25 13:15 Miguel
Posts: 181
|
Reply to #3:
Hi. With your examples work exactly as-is. Look at the "New File Name" column to see the changes. Perhaps you could provide some real examples. You can always use "Undo Batch" if there's a problem. Miguel |
#5 : 17/03-25 12:32 SunsetChill
Posts: 3
|
Reply to #4:
Ok I did not have the new file name column enabled so I can see the formatting now. Using your variables it took the ending and put in in front? example - Orginal file name Mosaic-Removed IPX-345 I'm Sorry Dad & Mom. AV Debut. Hattori using your input if did this Hattori Mosaic-Removed IPX-345 I'm Sorry Dad & Mom. AV Debut. What I'm trying to do IPX-345-Mosaic-Removed I'm Sorry Dad & Mom. AV Debut. Hattori I do have files that the title is not 3 but 4 characters so my thought is add an extra space to account and I can also do a rename cleanup to remove the extra space if needed. |
#6 : 17/03-25 14:19 Miguel
Posts: 181
|
Reply to #5:
Hi Sunset, Try this REPLACE: ^(\w.+) (\w+-\d+) REPLACE WITH: $2-$1 Use regular expression checked I hope this will work Miguel |
#7 : 07/04-25 19:16 Hubert
Posts: 14
|
Reply to #6:
Since I have a similar question, I don't want to start a new thread and am asking here. I have a file: Invoice_from_26.03.2012 I would like to move the date in the file name to the first position: The result should be: 26.03.2012_Invoice_from I tried using the Shift function Move from: (\d+) Move number: 8 Move to: 1 Result: .03.2012Invoice_from_26. What should the correct formula be? |
#8 : 07/04-25 19:50 Delta Foxtrot
Posts: 459
|
Reply to #7:
Hi Hubert, Personally I'd use the workhorse of regex methods, Replace: Replace: (.*)_([\d\.]+) Replace with: $2_$1 Occurrence: All or 1st Case sens.: unchecked Use regular expressions: checked Apply to: Name (No spaces in expressions) That says, create a container $1 to capture everything up to an underscore (which is discarded) that is followed by a bunch of numbers and periods, put that into a container $2, and move that container (plus a new trailing underscore) to before $1. Best, DF |