Welcome, Guest
Python Scripts for ComicRack

TOPIC: malor89's Perl Scripts

Re: malor89's Perl Scripts 7 years 4 weeks ago #11004

  • 600WPMPO
  • 600WPMPO's Avatar
  • Offline
  • Moderator
  • Posts: 3788
  • Thank you received: 557
  • Karma: 233
:woohoo: :woohoo: This is simply superb !!

Really making good directory listng. Here is the gijoes from my collection, now correctly sorted by makesort.pl:
gi	/./IDW/G.I. Joe/G.I. Joe [2008, ongoing]	
gi joe	/./IDW/G.I. Joe/G.I. Joe [2008, ongoing]	
gi joe a	/./IDW/G.I. Joe/G.I. Joe A Real American Hero	
gi joe a real	/./IDW/G.I. Joe/G.I. Joe A Real American Hero	
gi joe a real american	/./IDW/G.I. Joe/G.I. Joe A Real American Hero	
gi joe a real american hero	/./IDW/G.I. Joe/G.I. Joe A Real American Hero	
gi joe cobra	/./IDW/G.I. Joe/GI Joe Cobra II [4 issue mini-series 2010, ongoing]	
gi joe cobra ii	/./IDW/G.I. Joe/GI Joe Cobra II [4 issue mini-series 2010, ongoing]	
gi joe cobra special	/./IDW/G.I. Joe/GI Joe Cobra II [4 issue mini-series 2010, ongoing]	
gi joe cobra special chameleon	/./IDW/G.I. Joe/GI Joe Cobra II [4 issue mini-series 2010, ongoing]	
gi joe hearts	/./IDW/G.I. Joe/G.I. Joe Hearts & Minds	
gi joe hearts minds	/./IDW/G.I. Joe/G.I. Joe Hearts & Minds	
gi joe operation	/./IDW/G.I. Joe/G.I. Joe Operation HISS	
gi joe operation hiss	/./IDW/G.I. Joe/G.I. Joe Operation HISS	
gi joe origins	/./IDW/G.I. Joe/GI Joe Origins	
gi joe snake	/./IDW/G.I. Joe/G.I. Joe - Snake Eyes	
gi joe snake eyes	/./IDW/G.I. Joe/G.I. Joe - Snake Eyes	
gi joe the	/./IDW/G.I. Joe/G.I. Joe - The Rise of Cobra Movie Adaptation	
gi joe the rise	/./IDW/G.I. Joe/G.I. Joe - The Rise of Cobra Movie Adaptation	
gi joe the rise of	/./IDW/G.I. Joe/G.I. Joe - The Rise of Cobra Movie Adaptation	
gi joe the rise of cobra	/./IDW/G.I. Joe/G.I. Joe - The Rise of Cobra Movie Adaptation	
gi joe the rise of cobra movie	/./IDW/G.I. Joe/G.I. Joe - The Rise of Cobra Movie Adaptation	
gi joe the rise of cobra movie adaptation	/./IDW/G.I. Joe/G.I. Joe - The Rise of Cobra Movie Adaptation
Another +1 for my friend, the great malor89 ! :)
malor89 wrote:
New version of sortlist.pl
- added an option in makelist.pl to skip processing selected directories
How do I exclude more than one directories:
$skipdir = "0 Day";
Do I separate them by comma or semi-colon ?
malor89 wrote:
New version of sortlist.pl
- changed the detection algorithm, it now tries to match the entire title, removing a word at a time until it finds a match.
Sometimes, it still falters..

for example, it shows
superman	/./DC Comics/DCU/Superman Batman
instead of the corrdect:
superman	/./DC Comics/Metropolis/Superman

also, sometimes, it goes a bit too inside some directories. for example:
punisher frank castle	/./MAX comics/Punisher Frank Castle/066-070 Six Hours To Kill
I feel that when in this example it has found a perfect match for "punisher frank castle", it should stop there without going further in..

and it is still processing recycle bin entries
i00xxg4	/./$RECYCLE.BIN/S-1-5-21-1616972242-2797766019-1543469530-1001	
i0lkku3	/./$RECYCLE.BIN/S-1-5-21-1616972242-2797766019-1543469530-1001	
i0oonk9	/./$RECYCLE.BIN/S-1-5-21-1616972242-2797766019-1543469530-1001	
i1bp9iu	/./$RECYCLE.BIN/S-1-5-21-1616972242-2797766019-1543469530-1001	
i1nnv7l	/./$RECYCLE.BIN/S-1-5-21-1616972242-2797766019-1543469530-1001	
i1o2ksh	/./$RECYCLE.BIN/S-1-5-21-1616972242-2797766019-1543469530-1001	
i1trccp	/./$RECYCLE.BIN/S-1-5-21-1616972242-2797766019-1543469530-1001

Still, it is a great script & makes my work much easier.. I can't thank you enough malor !! :)
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 7 years 4 weeks ago #11013

  • malor89
  • malor89's Avatar
  • Offline
  • Senior Boarder
  • Posts: 73
  • Thank you received: 16
  • Karma: 17
New and Improved sortlist.pl
- sortlist.pl will now read a second file name "customlist.txt" that will override the settings in the "sortlist.txt" file generated by makesort.pl
- If prompting is enabled, when asked to move a file you can choose a custom path for the file by pressing 'c' and 'enter'. You'll be asked for the set the new path for the title matched. If you enter a valid path, the file will be moved there and a new entry will be added to the "customlist.txt" file. From then on, any similar matches will default to the newly set directory. The directory must already exist. Just press 'enter' and no text to skip moving the file and setting a new path.
- Tweaked makesort.pl to weight the value based on how much of the title is used. So the word 'superdud' in a comic titled "superdud" would be valued more than in the comic titled "superdud universe".
- Added System Volume Information and $RECYCLE.BIN the default directory to be skipped by makesort.pl
- Changed makesort.pl so it won't create a match based solely on the word "the".

Edit: This version is obsolete.
Last Edit: 7 years 4 weeks ago by malor89.
The administrator has disabled public write access.
The following user(s) said Thank You: 600WPMPO

Re: malor89's Perl Scripts 7 years 4 weeks ago #11017

  • 600WPMPO
  • 600WPMPO's Avatar
  • Offline
  • Moderator
  • Posts: 3788
  • Thank you received: 557
  • Karma: 233
Now this just goes on becoming better & better !! :)

System Volume Information and $RECYCLE.BIN entries are now successfully excluded.

The customlist function is a great concept !
malor89 wrote:
New and Improved sortlist.pl
- sortlist.pl will now read a second file name "customlist.txt" that will override the settings in the "sortlist.txt" file generated by makesort.pl
However, when i set the custom path to say:
Move: Superman 704 (2010).cbz
  to: /DC Comics/DCU/Superman Batman? c

Set directory for "superman" to: D:\DC Comics\Metropolis\Superman
Custom path set
It moves fine, but the customlist.txt remains empty :blink:
malor89 wrote:
- Tweaked makesort.pl to weight the value based on how much of the title is used. So the word 'superdud' in a comic titled "superdud" would be valued more than in the comic titled "superdud universe".
No, the sotlist still reads:
superman	/DC Comics/DCU/Superman Batman	
superman batman	/DC Comics/DCU/Superman Batman
So basically it is not saving the customlist.txt, or i'm doing something wrong ?

Overall, great work again by malor89 !!:)
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 7 years 4 weeks ago #11019

  • malor89
  • malor89's Avatar
  • Offline
  • Senior Boarder
  • Posts: 73
  • Thank you received: 16
  • Karma: 17
It still values directories based on the number of matching comics.
Did you let sortlist.pl finish? Customlist.txt doesn't get closed until the end, so the data might still be in the buffer without ever being written (I plan on fixing this), if you close it before it finishes. You can close it as soon as it says "Done". You can also just copy what you want to change from sortlist.txt and paste it into customlist.txt. The format is simply the matching text followed by a tab and then the directory. In the .txt files you can use either / or \ style directory seperators. Right now having a drive letter will cause problems, but the next update will strip off the drive letter.
Last Edit: 7 years 4 weeks ago by malor89.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 7 years 4 weeks ago #11020

  • 600WPMPO
  • 600WPMPO's Avatar
  • Offline
  • Moderator
  • Posts: 3788
  • Thank you received: 557
  • Karma: 233
malor89 wrote:
Did you let sortlist.pl finish?
:blush: oops.. yes, i admit i didn't let it finish..
malor89 wrote:
You can also just copy what you want to change from sortlist.txt and paste it into customlist.txt.
Just wanted to know that does the order in which we add entries to sortlist.txt matter ?
Or has it to be strictly in alphabetical order ?
malor89 wrote:
-Customlist.txt doesn't get closed until the end, so the data might still be in the buffer without ever being written (I plan on fixing this), if you close it before it finishes.
-Right now having a drive letter will cause problems, but the next update will strip off the drive letter.
Yes, these 2 updates would be most welcome.. eagerly awaiting.. :)
Now Playing: The ComicRack Manual (Online)

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

Re: malor89's Perl Scripts 7 years 4 weeks ago #11021

  • malor89
  • malor89's Avatar
  • Offline
  • Senior Boarder
  • Posts: 73
  • Thank you received: 16
  • Karma: 17
Minor Update for listsort.pl
- changed listsort.pl to update customlist.txt after each change, so changes don't get lost if you quit before it finishes.
- listsort.pl will now strip off any drive letters from the paths found in customlist.txt, so that you can cut and paste a path from Windows and it should work correctly.
- the matching text that listsort.pl saves to customlist.txt, when setting a custom path, will now be the entire (modified) title and not just whatever text it matched to the database.
- added a way for the makesort.pl to generate a complete listing of the comic files scanned. Just remove the # from in front of "#open (COMLIST"... It will save a file named comlist.txt in the comic directory. If anyone wants, I could use this file to test the sorting algorithm to improve the overall accuracy.
Attachments:
Last Edit: 7 years 4 weeks ago by malor89.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 7 years 3 weeks ago #11028

  • 600WPMPO
  • 600WPMPO's Avatar
  • Offline
  • Moderator
  • Posts: 3788
  • Thank you received: 557
  • Karma: 233
malor89 wrote:
..update customlist.txt after each change..
..strip off any drive letters from the paths found in customlist.txt..
Much appreciated..Thanks a lot malor89, the scripts are now getting quite sophisticated! :)
malor89 wrote:
Just remove the # from in front of "#open (COMLIST"... It will save a file named comlist.txt in the comic directory. If anyone wants, I could use this file to test the sorting algorithm to improve the overall accuracy.
Please check your private message inbox for my comlist.txt file.
Waiting eagerly for next update with enhanced accuracy !! ;)

p.s. I have updated your first post with a brief description of all the perl scripts posted by you, and the attached zip file contains all of them (the latest versions). Hope you don't mind.. please edit them further if you feel so..
Now Playing: The ComicRack Manual (Online)

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

Re: malor89's Perl Scripts 7 years 3 weeks ago #11029

  • malor89
  • malor89's Avatar
  • Offline
  • Senior Boarder
  • Posts: 73
  • Thank you received: 16
  • Karma: 17
600WPMPO wrote:
p.s. I have updated your first post with a brief description of all the perl scripts posted by you, and the attached zip file contains all of them (the latest versions). Hope you don't mind.. please edit them further if you feel so..
Thanks, your update looks good. I've been thinking that this thread is getting long enough that I'd probably should try to consolidate things sometime.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 7 years 3 weeks ago #11048

  • malor89
  • malor89's Avatar
  • Offline
  • Senior Boarder
  • Posts: 73
  • Thank you received: 16
  • Karma: 17
sortlist.pl & makesort.pl - Final version?
- The year listed in a comic's title is now used to improve sorting
- Added a list of single words not to use as the sole basis for sorting in makesort.pl
- If you choose to set a custom path for sorting a comic and a valid path is already on the clipboard, you are first ask if you want to use that path. So, before pressing 'c' you can copy the path you want to use instead of typing it by hand.
- If you skip moving a file, sortlist.pl with also skip moving the next file if it has a similar title.
- Added a "scanlevels" option to makesort.pl, which tell the script how deep into the subdirectories to scan. This can be used to prevent sortlist.pl from sorting to some obscure deep level subdirectory.

I've experimented with several other ways to improve the sorting accuracy, but they all resulted in miniscule differences, so I'm probably done working on these two scripts for now.
Attachments:
Last Edit: 7 years 3 weeks ago by malor89.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 7 years 3 weeks ago #11053

  • 600WPMPO
  • 600WPMPO's Avatar
  • Offline
  • Moderator
  • Posts: 3788
  • Thank you received: 557
  • Karma: 233
malor89 wrote:
..Final version?
:) Yes.. this is really the final version !!

solves our problem with this:
superman	/DC Comics/DCU/Superman Batman	
superman (2010)	/DC Comics/Metropolis/Superman
Almost perfect, and new features (scanlevels, year sorting filter) make it as perfect as it gets..!

No power in DC or Marvel could stop me from giving you a well-deserved karma boost !! B)
Some other scripts I could share are one the does simple file sorting, one that sets the modified date to the oldest file date in the archive, one that deletes non-image files (thumbs.db, links, etc.) from archives, a simple duplicate file finder. I don't want to waste time posting things people don't want, so speak up if something interests you.
And now I'm hungry for more perl..!! :woohoo:
Now Playing: The ComicRack Manual (Online)

See my new comics & gadgets on: Tumblr!
The administrator has disabled public write access.
Time to create page: 0.386 seconds

Who's Online

We have 227 guests and 2 members online