Moving comics

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
User avatar
pax0707
Posts: 63
Joined: 25 Jun 2014, 09:44

Moving comics

Post by pax0707 »

I have a large number of comics that I need to put into a folder structure.
Something like Sorted/*1st letter of name*/name/fn.ext.
The name should be anything before number followed by an open bracket or in case of volumes v*number* or "vol".
Any chance for a proper format expression that would help me do that?

Code: Select all

Belle - Oath of Thorns 05 (of 06) (2020) (digital) (The Seeker-Empire).cbr
Ascender 009 (2020) (Digital) (Zone-Empire).cbr
20XX 003 (2020) (Digital) (Mephisto-Empire).cbr
Star Wars - Darth Vader 001 (2020) (Digital) (Kileko-Empire).cbz
The After Realm 001 (2020) (Digital) (Mephisto-Empire).cbr
Hellboy v12 - The Storm and the Fury (2012) (Digital) (Zone-Empire).cbr
Hellboy v8 - Darkness Calls (2008) (Digital) (Zone-Empire).cbr
The Waking Vol 1 TPB (2010) (Digital) (K6-Empire).cbr
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Moving comics

Post by kim »

*1st letter of name* =

Code: Select all

{az}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Moving comics

Post by rednoah »

e.g. matching the substring before the first number pattern:

Code: Select all

fn.before(/\d/)
:idea: Please read the FAQ and How to Request Help.
User avatar
pax0707
Posts: 63
Joined: 25 Jun 2014, 09:44

Re: Moving comics

Post by pax0707 »

kim wrote: 26 Apr 2020, 22:25 *1st letter of name* =

Code: Select all

{az}
If 1st character is a number this gives me "0-9"
Is there a way to get that exact number?

Also, it ignores "a".
Puts "A Distant Soil" under D, "A Walk Through Hell" under W.
Last edited by pax0707 on 27 Apr 2020, 21:15, edited 1 time in total.
User avatar
pax0707
Posts: 63
Joined: 25 Jun 2014, 09:44

Re: Moving comics

Post by pax0707 »

rednoah wrote: 27 Apr 2020, 07:24 e.g. matching the substring before the first number pattern:

Code: Select all

fn.before(/\d/)
Thanks!
So far I got:

Code: Select all

D:/MEDIA/COMICS/SORTED/ENGLISH/{az}/{fn.before(/REGEXHERE/).upperInitial()}/{fn}

(\b(0)\d*\b)|(\b[vV]\d+\b)|(\(\d*\))|(\b[vV][oO][lL]\b)|(#(0)\d*)|(\b[bB][oO][oO][kK]\s\d+)
Still finding some edge cases.
Last edited by pax0707 on 27 Apr 2020, 23:30, edited 2 times in total.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Moving comics

Post by rednoah »

You can always pick the first letter yourself, if {az} default behaviour doesn't suit your purpose:

Code: Select all

{n[0].upper()}
:idea: Please read the FAQ and How to Request Help.
User avatar
pax0707
Posts: 63
Joined: 25 Jun 2014, 09:44

Re: Moving comics

Post by pax0707 »

rednoah wrote: 27 Apr 2020, 22:03 You can always pick the first letter yourself, if {az} default behaviour doesn't suit your purpose:

Code: Select all

{n[0].upper()}
Thank you!
This worked like a charm.
Post Reply