From: Galen Charlton Date: Tue, 7 Aug 2012 18:18:17 +0000 (-0400) Subject: make --reverse option work X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=938f5d4afc6323d3023e977ce75a382b7f3f4aad;hp=d10d13ffea1f2d6faeaaab789ebb1e690611d3d4 make --reverse option work Signed-off-by: Galen Charlton --- diff --git a/extract_loadset b/extract_loadset index 07d3a3a..aa29023 100755 --- a/extract_loadset +++ b/extract_loadset @@ -32,11 +32,7 @@ while () { chomp; my ($lead,$sub) = split /\t/; $sub =~ s/\s//g; # any whitespace is extraneous - if ($conf->{reverse}) { - $exclude{$lead} = 1 unless ($lead < $conf->{lowerbound}); - } else { - $exclude{$sub} = 1 unless ($sub < $conf->{lowerbound}); - } + $exclude{$sub} = 1 unless ($sub < $conf->{lowerbound}); } close FP; @@ -45,7 +41,11 @@ open MI, '<', $conf->{input} or die "Can't open input file: $!\n"; open MO, '>', $conf->{output} or die "Can't open output file: $!\n"; while () { m/tag="$conf->{tag}".+?(\d+){reverse}) { + print MO if $exclude{$1}; + } else { + print MO unless $exclude{$1}; + } }