Page 1 of 1

Moving comics

Posted: 26 Apr 2020, 20:38
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

Re: Moving comics

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

Code: Select all

{az}

Re: Moving comics

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

Code: Select all

fn.before(/\d/)

Re: Moving comics

Posted: 27 Apr 2020, 20:29
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.

Re: Moving comics

Posted: 27 Apr 2020, 20:30
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.

Re: Moving comics

Posted: 27 Apr 2020, 22:03
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()}

Re: Moving comics

Posted: 27 Apr 2020, 22:41
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.