]> git.rmz.io Git - dotfiles.git/blobdiff - bin/fix_numbering/fixFarthingWood
cleaning up bin
[dotfiles.git] / bin / fix_numbering / fixFarthingWood
diff --git a/bin/fix_numbering/fixFarthingWood b/bin/fix_numbering/fixFarthingWood
new file mode 100755 (executable)
index 0000000..82ec50c
--- /dev/null
@@ -0,0 +1,20 @@
+#! /usr/bin/perl
+
+###################################################################
+# This script fixes the series numbering for The Animal of        #
+# Farthing Wood
+###################################################################
+
+use warnings;
+use strict;
+
+foreach my $file (<*>) {
+       my $new_file;
+       $file =~ /(\d+)- (.*)/;
+       my $n = scalar $1;
+       $n -= 26; 
+       $n = length($n) == 1 ? "0$n" : $n;
+       $new_file = "3x$n $2";
+       print "$file -> $new_file\n";
+       rename($file,$new_file);
+}