Hi there,
I will like to identify garbage text in a file. I have tried the code below using the octave value of unprintable characters as the matching pattern but it does not seem to work. Any help will be much appreciated.
#!/usr/local/bin/oraperl
#
open(INP, $ARGV[0]) || die "Cannot open file! $USAGE \n";
while(<INP>) {
if ($_ =~ /[\000-\040]/)
{print "Garbage text exists in this file\n";}
else
{print $_;}
}
Thanks
I will like to identify garbage text in a file. I have tried the code below using the octave value of unprintable characters as the matching pattern but it does not seem to work. Any help will be much appreciated.
#!/usr/local/bin/oraperl
#
open(INP, $ARGV[0]) || die "Cannot open file! $USAGE \n";
while(<INP>) {
if ($_ =~ /[\000-\040]/)
{print "Garbage text exists in this file\n";}
else
{print $_;}
}
Thanks