From fc64b1074c476a60d9e1745523d1ae7a7478bb9c Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 20 Sep 2010 14:01:11 +0200 Subject: Add scripts/alternate-stream --- scripts/alternate-stream | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 scripts/alternate-stream (limited to 'scripts/alternate-stream') diff --git a/scripts/alternate-stream b/scripts/alternate-stream new file mode 100755 index 00000000..6a711722 --- /dev/null +++ b/scripts/alternate-stream @@ -0,0 +1,26 @@ +#!/usr/bin/perl -w + +use strict; + +open(FH, $ARGV[0]); +open(OFH_ONE, "> ".$ARGV[1]); +open(OFH_TWO, "> ".$ARGV[2]); + +my $line; +my $alt = 0; + +while ( $line = ) { + + if ( $line =~ /^Reflections\ from\ indexing/ ) { + $alt = 1 - $alt; + } + + if ( $alt == 0 ) { + printf(OFH_ONE $line); + } elsif ( $alt == 1 ) { + printf(OFH_TWO $line); + } else { + printf("Unhandled: '%s'\n", chomp($line)); + } + +} -- cgit v1.2.3