View previous topic :: View next topic |
Author |
Message |
hsun
Joined: 11 Jun 2011 Posts: 1
|
Posted: Sat Jun 11, 2011 12:19 pm Post subject: replacing numbers with characters only before "-" |
|
|
number to replace
1234567890 with ASDFGHJKLO
1 -> A, 2 -> S, 3 -> D, etc
Here is a case:
1. AB1213456-20000.jpg -> AB1213456_ABASADFGH-20000.jpg
the code before "-" will be copied and numbers before "-" will be replaced
is it possible to do such thing? |
|
Back to top |
|
|
admin Site Admin
Joined: 09 Mar 2007 Posts: 448 Location: Canada
|
Posted: Mon Jun 13, 2011 5:04 am Post subject: |
|
|
Hi,
Copy the following into the custom renaming creator (do not include the single quotes).
Row: 1
Search: '(.*)1(.*)-(.*)'
Replace: '\1A\2-\3'
Row: 2
Search: '(.*)2(.*)-(.*)'
Replace: '\1S\2-\3'
Row: 3
Search: '(.*)3(.*)-(.*)'
Replace: '\1D\2-\3'
You will have to repeat the pattern if the numbers can appear more than once. Or rerun the scan multiple times. Further modifications would be needed if more than one dash can appear in the name. YOu also have to add the translations for the other digits.
It's not an elegant solution but will do the job.
Hope this helps.
Peter. |
|
Back to top |
|
|
|