Changing folder names?
I have a collection of folders where I want a particular section of the folder name removed.
For example: Capitol Media Music The Professional 01 - Tom Elliot - Space Electronics (MERS-6)
What I want removed in that example is the "- Tom Elliot" portion. All other folders that I want to rename follow this same pattern, but the number of characters I want removed varies depending on the length of the artist name. So doing a Remove action won't ideally work, but Remove Pattern would work perfectly. However I'm confused about which format string to use. It seems like a simple action. Does anyone know what I should use?
For example: Capitol Media Music The Professional 01 - Tom Elliot - Space Electronics (MERS-6)
What I want removed in that example is the "- Tom Elliot" portion. All other folders that I want to rename follow this same pattern, but the number of characters I want removed varies depending on the length of the artist name. So doing a Remove action won't ideally work, but Remove Pattern would work perfectly. However I'm confused about which format string to use. It seems like a simple action. Does anyone know what I should use?
Hi Carlos,
I'd use replace anyway, assuming you still want to separate the two remaining parts of the filename with *something*.
REPLACE method:
replace: "\- ?[^\-]+? ?\-" (no quotes)
with: -
Case sens: Unchecked
Reg Exp: Checked! (I originally braindeadly wrote unchecked... duh)
Apply to: Name
This will remove a dash, anything not a dash, and then a dash again; so it will take out anything between your dashes. I replaced with a dash, but you can use whatever - or nothing.
EDIT: This will remove a dash and (maybe) a space, anything not a dash, and then (maybe) a space and dash; so it will take out anything between your dashes. [I also edited the "replace" text to mae the spaces non-mandatory] END EDIT
Best regards,
DF
I'd use replace anyway, assuming you still want to separate the two remaining parts of the filename with *something*.
REPLACE method:
replace: "\- ?[^\-]+? ?\-" (no quotes)
with: -
Case sens: Unchecked
Reg Exp: Checked! (I originally braindeadly wrote unchecked... duh)
Apply to: Name
This will remove a dash, anything not a dash, and then a dash again; so it will take out anything between your dashes. I replaced with a dash, but you can use whatever - or nothing.
EDIT: This will remove a dash and (maybe) a space, anything not a dash, and then (maybe) a space and dash; so it will take out anything between your dashes. [I also edited the "replace" text to mae the spaces non-mandatory] END EDIT
Best regards,
DF
Reply to #2:
Hi,
A simple REPLACE method without using regex will work
REPLACE: -*-
REPLACE WITH:- (This is optional)
Miguel
Hi,
A simple REPLACE method without using regex will work
REPLACE: -*-
REPLACE WITH:- (This is optional)
Miguel
Reply to #3:
You're absolutely right! Simple is good! :)
Leave it to me to complicate the thing...
Best,
DF
You're absolutely right! Simple is good! :)
Leave it to me to complicate the thing...
Best,
DF