Quote:
|
quote:i want to delete both first and 3rd sentences starting with bs5019 because they are the same
|
I think this is what you're after - this works on a *nix box.
Code:
charlie@maui $ cat b
bs5019 error: The document contains 68 carriage return characters
rol50141 error: The of element intra-ref is not correctly formatted.
bs5019 error: The document contains 68 carriage return characters
charlie@maui $ cat filt.pl
#!/usr/bin/perl
use warnings;
use strict;
my %hash;
while (<>){
next if ($hash{$_});
$hash{$_}=1;
print;
}
charlie@maui $ cat b | ./filt.pl
bs5019 error: The document contains 68 carriage return characters
rol50141 error: The of element intra-ref is not correctly formatted.
charlie@maui $
--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock:
http://charlieharvey.org.uk