aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2010-09-20 14:01:11 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:59 +0100
commitfc64b1074c476a60d9e1745523d1ae7a7478bb9c (patch)
tree725f4ab3f9336d76ecd3a593cc90f60439548b6b
parent4b28c88c0dafcb7acc9c573e84fc90b1c3d9a152 (diff)
Add scripts/alternate-stream
-rwxr-xr-xscripts/alternate-stream26
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));
+ }
+
+}