diff options
author | Thomas White <taw@bitwiz.org.uk> | 2010-09-20 14:01:11 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:26:59 +0100 |
commit | fc64b1074c476a60d9e1745523d1ae7a7478bb9c (patch) | |
tree | 725f4ab3f9336d76ecd3a593cc90f60439548b6b | |
parent | 4b28c88c0dafcb7acc9c573e84fc90b1c3d9a152 (diff) |
Add scripts/alternate-stream
-rwxr-xr-x | scripts/alternate-stream | 26 |
1 files changed, 26 insertions, 0 deletions
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 = <FH> ) { + + 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)); + } + +} |