B58013A7FF #### while () { chomp; my $out = ''; while ( /([0-9a-f]{2})/gi ) { $out .= ( uc($1) eq 'A7' ) ? "00" : $1; } print "$out\n"; } __DATA__ b58013A7FF #### binmode STDIN; binmode STDOUT; $/ = \8192; # set "input record separator" to 8KB per read while (<>) { tr/\xa7/\x00/; print; } #### script.pl < input.file > output.file