Hi loody,

On Sun, Nov 17, 2013 at 10:06 AM, loody <milo...@gmail.com> wrote:

> hi all:
> I try to eliminate below special character "^@" by perl in the attachment.
>
> I have tried  "$.*^' regular expression for elimination in perl but fail
>
   It would have been lovely to see how you tried that.

>
> Have anyone got the experience to eliminate such special character?
> (below are excerpted from the attachment)
>
> appreciate your help,
>
Using perl The substitution operator i.e s///g , could help. like so:
[CODE]
use warnings;
use strict;

my $str = do {
    local $/;
    <DATA>;
};

$str =~ s/\^@//g; # note here

print $str;

__DATA__
itd_submit 33189226 1 urb d7c54800 ep2in len 5120, 10 pkts 8 uframes
[dbab8900]
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@itd_submit
33190819 1 urb d7c54a00 ep2in len 5120, 10 pkts 8 uframes [dbab8900]
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ehci_urb_done
33205223 1 urb d7c54800 ep2in status 0 0
itd_submit 33205506 1 urb d7c54800 ep2in len 5120, 10 pkts 8 uframes
[dbab8900]
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ehci_urb_done
33215263 1 urb d7c54a00 ep2in status 0 0
 [/CODE]

You could check:
http://perldoc.perl.org/perlop.html#Regexp-Quote-Like-Operators


>
> itd_submit 33189226 1 urb d7c54800 ep2in len 5120, 10 pkts 8 uframes
> [dbab8900]
>
> ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@itd_submit
> 33190819 1 urb d7c54a00 ep2in len 5120, 10 pkts 8 uframes [dbab8900]
>
> ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ehci_urb_done
> 33205223 1 urb d7c54800 ep2in status 0 0
> itd_submit 33205506 1 urb d7c54800 ep2in len 5120, 10 pkts 8 uframes
> [dbab8900]
>
> ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ehci_urb_done
> 33215263 1 urb d7c54a00 ep2in status 0 0
>
>
> --
> Regards,
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>


-- 
Tim

Reply via email to