Rename file to only the characters within the brackets
File name currently Alice in Wonderland [SALE4Q].wbfs
I want it to be SALE4Q.wbfs
Thanks in advance. Love the product
Reply to #1:
Wow. I totally misread that question. My original answer stripped the stuff in the brackets out and left the rest.
I'll be right back.
Best,
DF
Wow. I totally misread that question. My original answer stripped the stuff in the brackets out and left the rest.
I'll be right back.
Best,
DF
Reply to #2:
Ok, this works for some examples I made up.
REPLACE method:
Replace: ^([^\[]*)\[([^\]]*)\](.*)$
Replace with: $2
NOT case sensitive
Use regular expressions: YES
Apply to: NAME
Sorry about the mix-up earlier, I hope you didn't see it! :)
Best,
DF
PS. If anyone needs to remove a set of square brackets and enclosed text from some filenames, I have a script for that... that's what I get for watching The Office while playing on the computer. :)
Aw, heck. Here are the scripts:
-------------------
// Trim everything outside square brackets (plus brackets):
var theRest = item.name ;
var theTarget = theRest.match(/([^\[]*)\[.*\](.*)$/) ;
var theReturn = theTarget[1] + theTarget[2];
theReturn = theReturn.trim();
return theReturn ;
---------------
// Trim all but what's in square brackets:
var theRest = item.name ;
var theTarget = theRest.match(/([^\[]*)\[([^\]]+)\](.*)/) ;
var theReturn = theTarget[2] ;
theReturn = theReturn.trim() ;
return theReturn ;
-------------
Ok, this works for some examples I made up.
REPLACE method:
Replace: ^([^\[]*)\[([^\]]*)\](.*)$
Replace with: $2
NOT case sensitive
Use regular expressions: YES
Apply to: NAME
Sorry about the mix-up earlier, I hope you didn't see it! :)
Best,
DF
PS. If anyone needs to remove a set of square brackets and enclosed text from some filenames, I have a script for that... that's what I get for watching The Office while playing on the computer. :)
Aw, heck. Here are the scripts:
-------------------
// Trim everything outside square brackets (plus brackets):
var theRest = item.name ;
var theTarget = theRest.match(/([^\[]*)\[.*\](.*)$/) ;
var theReturn = theTarget[1] + theTarget[2];
theReturn = theReturn.trim();
return theReturn ;
---------------
// Trim all but what's in square brackets:
var theRest = item.name ;
var theTarget = theRest.match(/([^\[]*)\[([^\]]+)\](.*)/) ;
var theReturn = theTarget[2] ;
theReturn = theReturn.trim() ;
return theReturn ;
-------------
Reply to #1:
Alternate way to accomplish your desired results:
- Replace method:
Replace:*[\]*
With: (empty)
Use regular expressions: No
Apply to: Name
-edited by DF
Alternate way to accomplish your desired results:
- Replace method:
Replace:*[\]*
With: (empty)
Use regular expressions: No
Apply to: Name
-edited by DF
Reply to #4:
Hey Styb,
That just gets rid of the brackets, not the stuff outside the brackets. But this works:
*[\]*
Good catch, though. A lot simpler than regex or scripts. I always forget that stuff! :)
Best,
DF
Hey Styb,
That just gets rid of the brackets, not the stuff outside the brackets. But this works:
*[\]*
Good catch, though. A lot simpler than regex or scripts. I always forget that stuff! :)
Best,
DF
Reply to #5:
Ooops !
I didn't understand the question. Thank you for the clarification.
Ooops !
I didn't understand the question. Thank you for the clarification.
Reply to #6:
No problem my friend. I didn't understand it the first time either!
And English is my ONLY language! :)
No problem my friend. I didn't understand it the first time either!
And English is my ONLY language! :)
Reply to #5: