QUOTE(micnorian14 @ Mar 17 2015, 06:40)

I hurt myself thinking too hard about this. My spare raspberry pi now hosts the server on a flashdrive with incredible performance to boot. It's low power, headless, secure, and by god it's effective - many times more so than any old laptop or frankensteined-desktop that you couldn't make yourself toss away after all those years.
I never did figure out a solid way to
1: specify that said files be
2: sorted into subfolders
3: based on
4: specific strings in the given file's name.
But oh well. Maybe the next version of hath will generate a fancy html-catalog with all the files in one big folder - much like an offline copy of the main site.
Wait. Why do we even save files locally when they'll always be available online forever?
There is a way to do what you want now that the tag field in galleryinfo.txt contains namespaces. Instead of parsing the filename you will need to parse galleryinfo.txt. I have a perl script that pulls the tag information to build the metadata file for use when importing the archived files into Comic Rack. Doing what you want shouldn't take too much extra effort. Parse the file for the tags you want and create the directory structure of your choice.
Feel free to mangle my script as you please to get your intended results.
CODE
#!/usr/bin/perl -w
use strict;
use warnings;
use Win32::Console::ANSI;
use Term::ANSIColor qw(:constants);
my $root = 'D:\Temp\hath';
my @comicHead = ("<?xml version=\"1.0\"?>\n", "<ComicInfo xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n", " <Genre>H Manga</Genre>\n", " <LanguageISO>en</LanguageISO>\n", " <AgeRating>Adults Only 18+</AgeRating>\n", " <Manga>YesAndRightToLeft</Manga>\n");
# Creates ComicInfo.XML from galleryinfo.txt for use by Comic Rack
#
# Exported info should include the following
# <Series></Series> == title
# <StoryArc></StoryArc> == maps from parody namespace
# <Writer></Writer> == maps from artist namespace
# <Summary></Summary> == includes whole galleryinfo.txt blob
# <Notes> ||| TAGS: 'list_of_tags' ||| </Notes> == used by "Retrieve TAGS from Notes" script in CR
opendir(DIR, $root) or die $!;
while (my $dir = readdir(DIR)) {
next if (-f $dir); # skip non-file entries
if (-f $root.'\\'.$dir.'\\galleryinfo.txt') {
open FILE, $root.'\\'.$dir.'\\galleryinfo.txt' or die $!;
my @lines = <FILE>;
close FILE or die $!;
open COMIC, ">$root\\$dir\\ComicInfo.xml" or die $!;
print COMIC @comicHead;
foreach my $line (@lines) {
$line =~ s/\<3/E3/g; # search for '<3' replace with 'E3'
if($line =~ /^Title:\s*(.*)$/) {
print GREEN;
printf '%.35s...', $1;
print RESET;
print COMIC " <Series>$1</Series>\n <Summary>$1</Summary>\n";
}
if($line =~ /^Tags:\s*(.*)$/) {
print " --> Has Tags\n";
print COMIC " <Notes> ||| TAGS: '$1' ||| </Notes>\n";
if($line =~ /artist:(?<artist>.*?),/) {
print COMIC " <Writer>$+{artist}</Writer>\n";
}
if($line =~ /parody:(?<parody>.*?),/) {
print COMIC " <StoryArc>$+{parody}</StoryArc>\n";
}
}
}
# print COMIC " <Summary>@lines</Summary>\n";
print COMIC "</ComicInfo>\n";
close COMIC or die $!;
}
else {
print RED ON_YELLOW "$dir ", RESET;
print "--> no GALLERY file\n";
}
}
print WHITE, ON_BLACK, "done";
closedir(DIR);
exit 0;