exclude multiple records

Hi
I need to exclude multiple records in file .Using grep -v ,can exclude that record
Ex: If want to exclude 0012777201,0012777202
use grep two times .Is there any command to achive this through single command ?( cann't use grep multiple times if need to exclude multiple records in husge file)

grep -v 0012777201 a.txt >a1.txt

grep -v 0012777202 a1.txt >a2.txt

a.txt

20080331|2505|0012777201|1|U|U|U|
20080331|2505|0012777202|1|U|U|U|
20080331|2505|0012777204|1|U|U|U|
20080331|2505|0012777205|1|U|U|U|
20080331|2505|0012777206|1|U|U|U|

Thanks,
MR

Hi,

You can overcome it by using doubt quotes, as follows.

grep -v "00127772*" a.txt >a1.txt

Thanks
Aketi

try egrep.
it can eat regular expressions
for your case:
egrep -v "001277720[12]" a.txt
or
egrep -v "00127772011|00127772012" a.txt

Hi All,

i have a requirement to exclude .csv from a file
I used cut -d ".csv",but its not working.
Can you please help

Hi

Its working,Thanks for your reply

Thanks
MR

but the most correct way is not using grep here. Because it potentially can match value from other fields.
Here is an awk solution:
awk '$3!=0012777201 && $3!=0012777202; BEGIN {FS="|"}' 1.txt