To remove the record from a file

Hi ,
In need to remove the record marked in red
My input is as below :
1|ETG|63121387883|Alternate|Y
2|||
3|79.58|||GBP||
4|001137001
4|0011372
5|1021701
5|1021901
1|ETG|63121387884|Alternate|Y
2|||
3|79.58|||GBP||
4|001137001
5|1021702
5|1021802
1|ETG|63128363077|Alternate|Y
2|||
2|EN_GB||Electrogalvanize 0.5 m2 ( Renault )
2|FR_GB||Electrogalvanize 0.5 m2 ( Renault )
3|88.51|||GBP||
4|001137001
4|001137002
5|1021901
5|7040500
1|ETG|63128363079|Alternate|Y
2|EN_GB||Electrogalvanize
2|||
4|001137005
5|2021901
5|8040500

My output is as below :
1|ETG|63121387883|Alternate|Y
2|||
3|79.58|||GBP||
4|001137001
4|0011372
5|1021701
5|1021901
1|ETG|63121387884|Alternate|Y
2|||
3|79.58|||GBP||
4|001137001
5|1021702
5|1021802
1|ETG|63128363077|Alternate|Y
2|EN_GB||Electrogalvanize 0.5 m2 ( Renault )
2|FR_GB||Electrogalvanize 0.5 m2 ( Renault )
3|88.51|||GBP||
4|001137001
4|001137002
5|1021901
5|7040500
1|ETG|63128363079|Alternate|Y
2|EN_GB||Electrogalvanize
4|001137005
5|2021901
5|8040500

Please let me if there are any commands for removing them.Any suggestions woild be hwlpful

Thanks in advance

use -v option of grep.

  • Put your data into file say "testfile".
    -
grep -v "2|||" testfile

this should give output without "2|||".

$nilesh