11-10-2011, 04:53 PM
i wrote a simple script for this:
and then run the commands:
ofc you can add more if your like.
Code:
#!/usr/bin/perl
use strict;
use warnings;
my $db2;
while (my $line = <>)
{
chomp ($line);
my $db1;
my $line_len = length ($line);
my $i;
for ($i = 0; $i < $line_len; $i += 2)
{
my $t = substr ($line, $i, 2);
last if (exists $db1->{$t});
$db1->{$t} = undef;
}
next if ($i < $line_len);
my @sorted_keys = sort keys %{$db1};
my $sorted_keys_s = join ("", @sorted_keys);
next if (exists $db2->{$sorted_keys_s});
$db2->{$sorted_keys_s} = undef;
print "$line\n";
}
and then run the commands:
Quote:$ mp64.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles1.rule
$ mp64.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles2.rule
$ mp64.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles3.rule
$ mp64.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles4.rule
$ mp64.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles5.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles2.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles3.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles4.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles5.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles3.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles4.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles5.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles4.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles5.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles5.rule
ofc you can add more if your like.