in reply to Re^2: Removing matched pattern except the first pattern
in thread Removing matched pattern except the first pattern

rahulruns,
It is deleting all the lines with procs...

WHICH?, your actual code or the codes I presented in Re: Removing matched pattern except the first pattern.
Maybe, you need to check your data and how you implemented the code given.
The output of the code presented perviously is:

procs -----------memory---------- ---swap-- -----io---- --system-- --- +--cpu----- r b swpd free buff cache si so bi bo in cs us s +y id wa st 0 0 0 50101200 234628 9636240 0 0 0 34 10782 6802 + 1 1 98 0 0 1 0 0 50102044 234628 9636276 0 0 0 96 8630 6980 +1 1 98 0 0 1 0 0 50113020 234628 9626112 0 0 0 3092 13393 10324 + 3 1 96 0 0 1 0 0 50111244 234628 9628188 0 0 0 1540 10106 8874 + 2 1 97 0 0 0 0 0 50111256 234628 9628228 0 0 0 0 8674 6961 +1 1 98 0 0 0 0 0 50109884 234628 9628228 0 0 0 280 11290 7593 + 1 1 97 0 0 0 0 0 50110672 234628 9628264 0 0 0 16 8886 7301 +1 1 98 0 0 1 0 0 50110708 234628 9628268 0 0 0 40 11285 6833 + 1 1 98 0 0 0 0 0 50101200 234628 9636240 0 0 0 34 10782 6802 + 1 1 98 0 0 1 0 0 50102044 234628 9636276 0 0 0 96 8630 6980 +1 1 98 0 0 1 0 0 50113020 234628 9626112 0 0 0 3092 13393 10324 + 3 1 96 0 0 1 0 0 50111244 234628 9628188 0 0 0 1540 10106 8874 + 2 1 97 0 0 0 0 0 50111256 234628 9628228 0 0 0 0 8674 6961 +1 1 98 0 0 0 0 0 50111256 234628 9628228 0 0 0 0 8674 6961 +1 1 98 0 0 0 0 0 50109884 234628 9628228 0 0 0 280 11290 7593 + 1 1 97 0 0 0 0 0 50110672 234628 9628264 0 0 0 16 8886 7301 +1 1 98 0 0 1 0 0 50110708 234628 9628268 0 0 0 40 11285 6833 + 1 1 98 0 0
Please, try it yourself TIY.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me