summaryrefslogtreecommitdiff
path: root/util/splitter-man
diff options
context:
space:
mode:
authorVasil Zlatanov <v@skozl.com>2019-06-24 21:31:41 +0100
committerVasil Zlatanov <v@skozl.com>2019-06-24 21:31:41 +0100
commit02f4425ceadec0c10c1e9903286c1121a9313357 (patch)
treecc8b2447ec0a5fa8d38926fd516823c62341c3d8 /util/splitter-man
downloade4-fyp-netcraft-master.tar.gz
e4-fyp-netcraft-master.tar.bz2
e4-fyp-netcraft-master.zip
Public FYP ReleaseHEADmaster
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");