Remove text inside brackets & abbreviate it

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Ruriko
Junior Member
Junior Member
Posts: 19
Joined: 2012-08-26, 12:50 UTC

Remove text inside brackets & abbreviate it

Post by *Ruriko »

How do I remove text inside brackets including the brackets too? and then abbreviate each word in the filename? example the filename is

Code: Select all

[HorribleSubs] Haiyore! Nyaruko-san W - 10 [1080p].mkv
it should be renamed as

Code: Select all

_H_N_W_-_10_.mkv
basically only the first letter remains and spaces get replaced with underscores
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

Three steps in MRT, only RegEx checked:

Search/Replace:

Code: Select all

\[[^\]]*\]
<clear>

<space>
_

_([^_\d])[^_]*
_$1
User avatar
white
Power Member
Power Member
Posts: 6016
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

It's more fun to do it like this:

Code: Select all

Rename mask: file name: [N1]_[N2]_[N3]_[N4]_[N5]_[N6]_[N7]_[N8]_[N9]_[N10]_[N11]_[N12]_[N13]_[N14]_[N15]_[N16]_[N17]_[N18]_[N19]_[N20]_[N21]_[N22]_[N23]_[N24]_[N25]_[N26]_[N27]_[N28]_[N29]_[N30]_[N31]_[N32]_[N33]_[N34]_[N35]_[N36]_[N37]_[N38]_[N39]_[N40]_[N41]_[N42]_[N43]_[N44]_[N45]_[N46]_[N47]_[N48]_[N49]_[N50]_[N51]_[N52]_[N53]_[N54]_[N55]_[N56]_[N57]_[N58]_[N59]_[N60]_[N61]_[N62]_[N63]_[N64]_[N65]_[N66]_[N67]_[N68]_[N69]_[N70]_[N71]_[N72]_[N73]_[N74]_[N75]_[N76]_[N77]_[N78]_[N79]_[N80]_[N81]_[N82]_[N83]_[N84]_[N85]_[N86]_[N87]_[N88]_[N89]_[N90]_[N91]_[N92]_[N93]_[N94]_[N95]_[N96]_[N97]_[N98]_[N99]_

Search for:     \[.*?\]_|(\d)_|([^\s_])_([^\s_]_)*|\s(_)|_
Replace with:   $1$2$4

RegEx:          Checked
1x (E) Subst:   Not checked

Ruriko
Junior Member
Junior Member
Posts: 19
Joined: 2012-08-26, 12:50 UTC

Post by *Ruriko »

white wrote:It's more fun to do it like this:

Code: Select all

Rename mask: file name: [N1]_[N2]_[N3]_[N4]_[N5]_[N6]_[N7]_[N8]_[N9]_[N10]_[N11]_[N12]_[N13]_[N14]_[N15]_[N16]_[N17]_[N18]_[N19]_[N20]_[N21]_[N22]_[N23]_[N24]_[N25]_[N26]_[N27]_[N28]_[N29]_[N30]_[N31]_[N32]_[N33]_[N34]_[N35]_[N36]_[N37]_[N38]_[N39]_[N40]_[N41]_[N42]_[N43]_[N44]_[N45]_[N46]_[N47]_[N48]_[N49]_[N50]_[N51]_[N52]_[N53]_[N54]_[N55]_[N56]_[N57]_[N58]_[N59]_[N60]_[N61]_[N62]_[N63]_[N64]_[N65]_[N66]_[N67]_[N68]_[N69]_[N70]_[N71]_[N72]_[N73]_[N74]_[N75]_[N76]_[N77]_[N78]_[N79]_[N80]_[N81]_[N82]_[N83]_[N84]_[N85]_[N86]_[N87]_[N88]_[N89]_[N90]_[N91]_[N92]_[N93]_[N94]_[N95]_[N96]_[N97]_[N98]_[N99]_

Search for:     \[.*?\]_|(\d)_|([^\s_])_([^\s_]_)*|\s(_)|_
Replace with:   $1$2$4

RegEx:          Checked
1x (E) Subst:   Not checked

Thanks, this is the best one since it's all in one go! :D
Post Reply