#1 2012-02-04 03:05

arcanum
Member
Registered: 2012-02-04
Posts: 2

Remove anime tags

I'm hoping someone can help me, basically I want to create a rule that will take a filename like this:
[aTag] aFilename - 01.mkv
and remove the [aTag] portion regardless of what it actually contains (e.g. [superaweseomesub] or [iLikeMilk] )
leaving:    aFilename - 01.mkv

I think my problem is to do with making renamer see the [square brackets] as non-wildcard characters, because:   *]  does not work.

Any ideas?

Offline

#2 2012-02-04 10:37

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Remove anime tags

Hi and welcome.

arcanum wrote:

FROM:
[aTag] aFilename - 01.mkv

remove the [aTag]
TO:
aFilename - 01.mkv

Please try if this will help you:

Rule CleanUp: Strip out contents of brackets [..] , Fix spaces (skip extension)




See our wiki for more: http://www.den4b.com/wiki/ReNamer:Rules:CleanUp


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#3 2012-02-04 10:57

arcanum
Member
Registered: 2012-02-04
Posts: 2

Re: Remove anime tags

Great  smile  Don't know how I missed that.

I guess though in some circumstances I would only want to strip the first set of brackets in a filename.

So orginally,
[firstTag] fileNameHere [2ndTag] [3rdTag]. extension

but I want
fileNameHere [2ndTag] [3rdTag]. extension

I'd appreciate it if anyone knows a simple method of achieving this although I can live with it as it is.

Offline

#4 2012-02-04 19:44

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Remove anime tags

arcanum wrote:

FROM:
[firstTag] fileNameHere [2ndTag] [3rdTag].ext

TO:
fileNameHere [2ndTag] [3rdTag].ext

I have know that would be come next tongue

It would be nice if we had the option to ably each rule at the first occurrence only (or at n'th occ, for that matter)
For an few rules we have the option to ably at "All", "First" and "Last", but often we need an freeform "n'th occ",
and then this feature should be available on all rules where that makes sense.

In the meantime we can use an PascalScript or an RegEx rule to solve this.

For your issue try RegEx:
1) RegEx: Replace expression "^\[.+?] (.+)" with "$1" (skip extension)

Exp: "^\[.+?] (.+)"
Rep: "$1"


Explanation:
"..." ==> don't use the quotes, they are for clarification only
^===> match at start of string
\[ ===> match literal "["
.+? ==> match one-or-more of any sign, non-greedy (remove the '?' to see the effect)
] ===> match literal "]"
(.+) ==> match one-or-more of any sign, store in group "$1"

Then replace with what is matched with the second regex (.+) and stored in group $1


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

Board footer

Powered by FluxBB