kingsolo wrote:Okay, this is my first attempt at this, so let me see if I found everything in the forums I need. 2 different scenarios:
#1-
FROM:
The Lovely Bones - 2009.avi
TO:
The Lovely Bones (2009).avi
Do:
RegEx(1)
Match: (.+)(\d\d\d\d)
Repla: \1(\2)
Repl(3)
Replace: " - "
With: ""
#2
FROM:
Gossip Girl - S04E10 - 2010.avi
TO:
Gossip Girl S04E10.avi
Do:
RegEx(1)
Match: (.+)(\d\d\d\d)
Repla: \1 \2 (\3)
Repl(3)
Replace: " - "
With: ""
Is this correct?
Hi kingsolo, welcome.
kingsolo> "Is this correct?"
If it works for you, then yes
(there is no wrong or right, all depends of your real file names and of your needs)
Lets see what i would do:
(untested from my side, please test with some copies of your real files)
-----------------------------------------------
FROM:
The Lovely Bones - 2009.avi
TO:
The Lovely Bones (2009).avi
Do:
RegEx(1)
Match: (.+) - (\d\d\d\d)
[Explanation: (find all till), space, dash, space, (four digits)]
Repla: \1 (\2)
[Explanation: replace whit what is matched by the regex inside the first (...), dropping the middle part, insert an '(', paste what is
matched by the regex inside of the second (...), insert an ')' ]
-----------------------------------------------
FROM:
Gossip Girl - S04E10 - 2010.avi
TO:
Gossip Girl S04E10.avi
Do:
RegEx(1)
Match: (.+) - \d\d\d\d
[Explanation: (find all till), space, dash, space, four digits]
Repla: \1
[Explanation: replace whit what is matched by the regex inside the first (...), dropping the dash and the 4 digits.]
Repl(3)
Replace: " - "
With: ""
----------------------------------------------- OR
FROM:
Gossip Girl - S04E10 - 2010.avi
TO:
Gossip Girl S04E10.avi
Do:
RegEx(1)
Match: (.+) - (.+) - \d\d\d\d
[Explanation: (find all till), space, dash, space, (find all till), space, dash, space, four digits]
Repla: \1 \2
[Explanation: replace whit what is matched by the regex inside the first (...), dropping the first dash,
paste in what is matched by the regex inside the second (...), dropping the second dash and the 4 digits.]
-----------------------------------------------
HTH?