Welcome, Guest
Python Scripts for ComicRack

TOPIC: malor89's Perl Scripts

Re: malor89's Perl Scripts 6 years 10 months ago #11141

  • malor89
  • malor89's Avatar
  • Offline
  • Senior Boarder
  • Posts: 73
  • Thank you received: 16
  • Karma: 17
undorenamed.pl
This script lets you easily undo any name changes made by setmodified.pl and/or fixnames.pl.
This script reads the renamed.txt file and changes the file names back to the original names. By default it will prompt you before making/undoing any changes.

This would allow you to run setmodified.pl with prompting off when processing a large comic collection which can take a while, and then quickly review the name changes made by running undorenamed.pl with prompting on. Also, before running undorenamed.pl, the renamed.txt file can be reviewed and edited with a text editor (notepad) to delete lines containing name changes you want to keep and the original file name can even be edited so that the file will be renamed to a entirely new name.

Updated the code to handle both / and \ style paths.
Attachments:
Last Edit: 6 years 10 months ago by malor89.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 10 months ago #11145

  • 600WPMPO
  • 600WPMPO's Avatar
  • Offline
  • Moderator
  • Posts: 3788
  • Thank you received: 557
  • Karma: 232
malor89 wrote:
undorenamed.pl
This script lets you easily undo any name changes made by setmodified.pl and/or fixnames.pl.
This script reads the renamed.txt file and changes the file names back to the original names. By default it will prompt you before making/undoing any changes.
This script is again a very good idea !! :)

However, When i run the undorenamed.pl in a folder with renamed.txt (generated earlier by fixnames.pl), it doesn't prompt/change any filename but simply opens a command prompt that says "...Done".

Am I doing anything wrong ? or do i have to edit the file in some way before i make it work ?
Now Playing: The ComicRack Manual (Online)

See my new comics & gadgets on: Tumblr!
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 10 months ago #11148

  • malor89
  • malor89's Avatar
  • Offline
  • Senior Boarder
  • Posts: 73
  • Thank you received: 16
  • Karma: 17
600WPMPO wrote:
However, When i run the undorenamed.pl in a folder with renamed.txt (generated earlier by fixnames.pl), it doesn't prompt/change any filename but simply opens a command prompt that says "...Done".
My mistake. I tested it on a file created from the output of setmodified.pl which used "\" style paths and didn't notice I used "/" style paths for fixnames.pl. So I've updated the script's post with a new version that should work for both cases.
Last Edit: 6 years 10 months ago by malor89.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 10 months ago #11149

  • 600WPMPO
  • 600WPMPO's Avatar
  • Offline
  • Moderator
  • Posts: 3788
  • Thank you received: 557
  • Karma: 232
malor89 wrote:
..I've updated the script's post with a new version that should work for both cases.
Thanks.. it is working now !! :)

I would like to repeat a request..
A script called something like addvariant.pl

I often like to add variant covers to an existing archive. An addvariant.pl script could make this very easy. All it would require is that the archive and the cover have comparable file names. For example, for an archive like:
Incredible Hulks 614 (2010) (Minutemen-Fiji).cbr
the variant is:
Incredible Hulks 614 (2010) (Salvador Espin Vampire Variant) (Cover ONLY) (ScanDog).jpg
The script would search for the variant jpg in the archive directory (and if possible, in the sub-directories) and add the variant jpg to the matching archive.
Any chances of this actually becoming a real script..? :unsure:
Now Playing: The ComicRack Manual (Online)

See my new comics & gadgets on: Tumblr!
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 10 months ago #11151

  • malor89
  • malor89's Avatar
  • Offline
  • Senior Boarder
  • Posts: 73
  • Thank you received: 16
  • Karma: 17
600WPMPO wrote:
The script would search for the variant jpg in the archive directory (and if possible, in the sub-directories) and add the variant jpg to the matching archive. Any chances of this actually becoming a real script..? :unsure:
I'll see if I can put something together.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 10 months ago #11161

  • malor89
  • malor89's Avatar
  • Offline
  • Senior Boarder
  • Posts: 73
  • Thank you received: 16
  • Karma: 17
addvariant.pl
Places image files in the current directory into comic archives with matching names
By default it will move any placed images to a folder named "done" if it exists. There is an option in the script to delete the original image file instead.

Example:
Place: "St-ew 05 (variant cover).jpg" into:
  1 - \comics\Stew\Stew 005 (2009) (c2c) (null-DCP).cbr
  2 - \comics\Stew\Stew 05 (2009) (c2c) (Minutemen-Jackie Tyler).cbr
Usage: Place the script into the directory with the image files you want placed into comic archives. Set any variables that need changing at the beginning of the addvariant.pl script. Double click on addvariant.pl and press the matching # and 'enter' to select were to place the file. If you just press enter it will skip the image.
Attachments:
Last Edit: 6 years 10 months ago by malor89.
The administrator has disabled public write access.
The following user(s) said Thank You: perezmu

Re: malor89's Perl Scripts 6 years 10 months ago #11162

  • 600WPMPO
  • 600WPMPO's Avatar
  • Offline
  • Moderator
  • Posts: 3788
  • Thank you received: 557
  • Karma: 232
malor89 wrote:
addvariant.pl
Places image files in the current directory into comic archives with matching names
Wow..You did it !! :woohoo:

The script is working perfectly..


I am highly grateful to you malor89 for making this script..!

All i can give you is good karma & a big thank you :)

Now Playing: The ComicRack Manual (Online)

See my new comics & gadgets on: Tumblr!
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 10 months ago #11163

  • malor89
  • malor89's Avatar
  • Offline
  • Senior Boarder
  • Posts: 73
  • Thank you received: 16
  • Karma: 17
600WPMPO wrote:
malor89 wrote:
Wow..You did it !! :woohoo:

The script is working perfectly..

I am highly grateful to you malor89 for making this script..!

All i can give you is good karma & a big thank you :)

Glad it's working for you and finally on a first attempt.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 10 months ago #11164

  • 600WPMPO
  • 600WPMPO's Avatar
  • Offline
  • Moderator
  • Posts: 3788
  • Thank you received: 557
  • Karma: 232
Well, we have now got a good assortment of perl scripts that any comic collector would be proud to have & use. :)

Much encouraged by your skills, I have been brain-storming regarding some new ideas for more perl scripts for comic management. Here are 4-5 of my ideas.. Let us see which of these are good enough..?! :P
  • A 0-day folder script: a script that uses the "created date" of the jpgs in the archive and moves them into folders named on the basis of the 0-day release date.The 0-days are traditionally Wednesdays, and the folders would have names like
    2010.11.03 
    2010.11.10 
    2010.11.17 
    2010.11.24
    . This script can also have options for having just the year or the month as the folder name.

  • A script that suffixes the year (from which the archives start) to the folder name.
  • e.g. If a folder contains files like
Wolverine 01 (2010).cbz
  	Wolverine 02 (2010).cbz
  	Wolverine 03 (2011).cbz
The folder would be renamed as
Wolverine (2010)

  • A mini-series file renaming script: a script that adds # (of #) in the filenames of archives belonging to a set number of issues.
  • e.g. a file which we know to belong to, say, a 4-issue mini-series, like
    Infinite Horizon 04 (2010).cbz
    would be named
    Infinite Horizon 04 (of 04) (2010).cbz


  • A mini-series folder renaming script: a script that uses the filenames of archives having # (of #) in the filename to rename their containing folder having th suffix ongoing or complete, based on the # (of #) values. e.g. a folder containing files
    Infinite Horizon 01 (of 04) (2010).cbz
      Infinite Horizon 02 (of 04) (2010).cbz
      Infinite Horizon 03 (of 04) (2010).cbz
    would be renamed something like
    Infinite Horizon [4 issue mini-series 2010, ongoing]
    "ongoing" since the folder has only 3 of the 4 files required to label the mini-series as "complete". Once this folder also gets the last file in the series.. i.e.
    Infinite Horizon 04 (of 04) (2010).cbz
    , the script would re-name the folder to
    Infinite Horizon [4 issue mini-series 2010, complete]
    If this seems too far-fetched, a simple [ongoing] or [complete] suffix will also do.


  • A folder-name stripping script: a script that can strip the folder name of any bracketed suffixes. This would be useful for streamlining a comics library that contains some folders with names suffixed by the volume or year or any other tags in brackets. The script would remove all the bracketed suffixes and just keep the series name as the folder name.

  • While the scripts already posted are quite sufficient for basic comic management, some of these script ideas might be useful for advanced users. What do you say malor ? :unsure: Or any new script ideas that you've been thinking about ?
    Now Playing: The ComicRack Manual (Online)

    See my new comics & gadgets on: Tumblr!
    Last Edit: 6 years 10 months ago by 600WPMPO.
    The administrator has disabled public write access.

    Re: malor89's Perl Scripts 6 years 10 months ago #11165

    • malor89
    • malor89's Avatar
    • Offline
    • Senior Boarder
    • Posts: 73
    • Thank you received: 16
    • Karma: 17
    Your script ideas look interesting. Would anyone else like me to implement one of those or another script?

    I'm currently working on updating the fixnames.pl to include prompting and some other features that have become standard with the later scripts. Plus I'm tweaking the algorithms to improve the results a little.
    The administrator has disabled public write access.
    Time to create page: 0.241 seconds

    Who's Online

    We have 184 guests and 9 members online