Welcome, Guest
Python Scripts for ComicRack

TOPIC: Import tags from filename with regular expressions

Re: Import tags from filename with regular expressions 6 years 8 months ago #12839

  • MoDy
  • MoDy's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
My Filnames are Sortet:
For Example
Folder: Aquablue - 1996 bis 2000 - Feest (The Series, than the Date, and then the Publisher)

Into the Folder the Filenames are:

Aquablue - 01 - Aquablue - Thierry Cailleteau & Olivier Vatine.cbz
Aquablue - 02 - Der blaue Planet - Thierry Cailleteau & Olivier Vatine.cbz
Aquablue - 03 - Megophias - Thierry Cailleteau & Olivier Vatine.cbz
Aquablue - 04 - Schwarze Korallen - Thierry Cailleteau & Olivier Vatine.cbz
Aquablue - 05 - Das Atalanta Projekt - Thierry Cailleteau & Ciro Tota.cbz

(The Series, than the Number, than the Title and than the Writer and Penciller)

Could anybody help me to do this in the script.
Sorry for my english
MoDy
The administrator has disabled public write access.

Re: Import tags from filename with regular expressions 6 years 8 months ago #12842

  • freMea
  • freMea's Avatar
  • Offline
  • Junior Boarder
  • Posts: 38
  • Thank you received: 5
  • Karma: 1
@MoDy

Take a look at this post [REQUEST] New parsing script.

You can get inspiration from the regex in it.

You can have a look at another more advanced script: Library Organizer
Last Edit: 6 years 8 months ago by freMea.
The administrator has disabled public write access.

Re: Import tags from filename with regular expressions 6 years 8 months ago #12861

  • MoDy
  • MoDy's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
Libery Organizer is very good.
But i don not want to rename my files on my harddisc.
I only want to get the Information from my folder and my filename.
(Information is Series-Year-Publisher from the folder and Series-Number-Title-Writer&Penciller
from the filename)
And this Information should be written into the INFO Panell(I hope Panell is the right word)from ComicRack.
The administrator has disabled public write access.

Re: Import tags from filename with regular expressions 6 years 8 months ago #13073

  • MoDy
  • MoDy's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
Is there nobody in this big universe to help me ?
Please
MoDy
The administrator has disabled public write access.

Re: Import tags from filename with regular expressions 6 years 8 months ago #13075

  • Yellowbox
  • Yellowbox's Avatar
  • Offline
  • Junior Boarder
  • Posts: 25
  • Thank you received: 10
  • Karma: 3
Okay, here ya go:

\\(?<Series>[^\\\-]+?) - (?<Year>\d+)[^\\\-]+? - (?<Publisher>[^\\\-]+?)\\.+? - (?<Number>\d+) - (?<Writer>[^\\\-]+?) & (?<Penciller>[^\\\-]+?)

I did this quick on my iPhone for you, so it may not be perfect, but it's a start. If you have further problems, try downloading Expresso and tweaking it until it works.

Hope it helps!
The administrator has disabled public write access.
The following user(s) said Thank You: MoDy

Re: Import tags from filename with regular expressions 6 years 7 months ago #13940

  • chistrix
  • chistrix's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
I has been using this script for a while and worked great. I upgraded to v 0.9.140 64 bits. When I used the script it's importing the whole filename path.
Here is an example of the data:

Filename:
House of Secrets 153 The Resurrection Busness! (Sep 78) (Teachbug)

Regex:
(?<Series>[\D]*?)(?<Number>\d+).+

ComicRack Series tag:
C:\Comics\Comics\Vertigo\House of Secrets\House of Secrets
Last Edit: 6 years 7 months ago by chistrix.
The administrator has disabled public write access.

Re: Import tags from filename with regular expressions 6 years 6 months ago #14651

With the creation of the Scanner Information field, I'm ready to get to work on importing a lot of data quickly. While I've got some ability to code Regex, the ComicRack Regex is still a bit of a mystery to me.

Here's what I'm dealing with. My system automatically formats new downloads like this:

Astonishing Thor #004×005 (2011-07) [Minutemen-HawaiianPunch]
Avengers Academy v01 #014 (2011-07) [Minutemen-DTs]

I've always got a simple SERIES, followed by an optional VOLUME entry. Then the NUMBER, followed by an optional OF. Then everything gets simple again. In the parenthesis are the YEAR and MONTH. In the braces are the SCANNER INFO.

The place I'm having trouble is the optional fields: VOLUME and OF. If anyone can point me in the right direction, I'd be grateful.
The administrator has disabled public write access.

Re: Import tags from filename with regular expressions 6 years 6 months ago #14878

  • DerMicha
  • DerMicha's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
Hi,

I need help. I only want to extract the title attribute from files like "001 - Der Kolumbusfalter.cbr".

Either I get an error message that there is not match or the window closes and does nothing. is there a logfile? Do I have to install another tol?

Thank you

Micha
Last Edit: 6 years 6 months ago by DerMicha.
The administrator has disabled public write access.

Re: Import tags from filename with regular expressions 5 years 11 months ago #19849

Hi guys,

I made this regex that can sort for me the following kinds of expressions.
\[(?<Writer>[^\\]+?)\]\s?(?<Series>.+?)(?:\s?vol\.\s?(?<Volume>\d*?))?(?:\s?ch\.\s?(?<Number>\d*?))?(?:\s?\((?<AlternateSeries>.*?)\))?\.


[Chaccu Tiki] Iniocho vol.1 ch.2 (English).cbz
[Chaccu Tiki] Iniocho vol.1(English).cbz
[Chaccu Tiki] Iniocho (English).cbz
[Chaccu Tiki] Iniocho vol.1.cbz
[Chaccu Tiki] Iniocho ch.2.cbz
[Chaccu Tiki] Iniocho.cbz

It runs smoothly on Expresso, but it gives me errors with the script. Could any knowledgeable one shed some light over this?
Thanks
The administrator has disabled public write access.

Re: Import tags from filename with regular expressions 5 years 10 months ago #20110

  • Dragonator
  • Dragonator's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
I've just started using Comicrack and find it's automated functions interesting, though at times annoying. For example when guessing the series name. I store my manga in archives in folders for each series and all folders in a main manga folder. The typical path for a volume or chapter archive is as follows:

"..\Manga\Series\Series v01 c01-0x.extension"

From this CR extracts the series name: "Series c01" instead of just "Series".

While browsing the forums for a solution to this I found this script. I think it might solve this issue but I haven't been able to get it to work. I have installed it by going to the Preferences window -> Scripts, clicking install in the Script Packages section, selecting "script archive" from the drop-down list, selecting the archive for this script, clicking OK and restarting the application. However I seem to be unable to locate any reference to this script in the UI except for the script list, where it appears under "Edit/Update Books Commands" and it's check-box is checked. I found the contents of the archive in the "..\AppData\Roaming\cYo\ComicRack\Scripts\Tags From Name\" folder, so I presume it installed correctly.

My question is: How can I use this script and what regex should I use for the example above to parse the correct series name?

Thank you,
Dragonator.

EDIT: Never mind. I think I figured it out. I found it in the automation context menu for each title in the library list. Now I just have to tinker with the regex to fit my patterns. Oh joy.
Last Edit: 5 years 10 months ago by Dragonator. Reason: Problem solved.
The administrator has disabled public write access.
Time to create page: 0.234 seconds

Who's Online

We have 218 guests and one member online