X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/61d7dd11d4a450a64f2817ee4db0ec7fa5880b42..b9e4a0c3af29391c27e9a020693541b9a86c4d14:/bin/fix_numbering/fix4400?ds=inline diff --git a/bin/fix_numbering/fix4400 b/bin/fix_numbering/fix4400 new file mode 100755 index 0000000..b9cead6 --- /dev/null +++ b/bin/fix_numbering/fix4400 @@ -0,0 +1,23 @@ +#! /usr/bin/perl + +################################################################### +# This script fixes the series numbering for season 2 of the 4400 # +################################################################### + +use warnings; +use strict; + +foreach my $file (<*>) { + my $new_file; + if ($file =~ /part1/) { + $new_file = "2x01.avi"; + } else { + $file =~ /E(\d+)/; + my $n = scalar $1; + $n += 1; + $n = length($n) == 1 ? "0$n" : $n; + $new_file = "2x$n.avi"; + } + print "$file -> $new_file\n"; + rename($file,$new_file); +}