summaryrefslogtreecommitdiff
path: root/util/splitter-man
diff options
context:
space:
mode:
Diffstat (limited to 'util/splitter-man')
-rwxr-xr-xutil/splitter-man30
1 files changed, 30 insertions, 0 deletions
diff --git a/util/splitter-man b/util/splitter-man
new file mode 100755
index 0000000..fbdef17
--- /dev/null
+++ b/util/splitter-man
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+my $target;
+my $md5_hash;
+my $png;
+my $count = 0;
+
+
+while (<>){
+ if (/(.*),,,vas,,,(.*),,,vas,,,(.*)/) {
+ if($target){
+ mkdir "images/$target" unless -d "images/$target";
+ open(my $fh, '>', "images/$target/$target-$md5_hash.png") or die "could not write";
+ print $fh $png;
+ close $fh;
+ }
+ $count++;
+ $target = $1;
+ $md5_hash = $2;
+ $png = $3."\n";
+ } else {
+ $png.=$_;
+ }
+}
+
+mkdir "images/$target" unless -d "images/$target";
+open(my $fh, '>', "images/$target/$target-$md5_hash.png") or die;
+print $fh $png;
+close $fh;
+
+print($count, " images written\n");