exa_resu_adj.4ge v.47645 PERSONAL INFORMAIONS PVT LTD 31 Dec 2009 04:36 Page 1
SALARY REPORT
Account Account Name CCode Bill No Balance T Amt
----------- ------------ ------- ---------- ------------- -------------
17490001 Mr Ram PM 10 1000.00 -1000.00
17490006 Mr Dom AM 10 1000.00 -1000.00
17490003 Mis Pr PM 10 1000.00 -1000.00
-------------
TOTAL : -3000.00
-------------
NUMBER : 3
-------------
-------------
REPORT TOTAL : -3000.00
-------------
TOTAL NUMBER: 3
End of Report Requested by: kattoor
Here I need to remove the following fields
exa_resu_adj.4g3 v.47645
and
End of Report Requested by: kattoor
sed -e '/exa_resu_adj.*/d' -e '/End of Report.*/d' file
Be interesting to know which is quicker ?
---edit---
Not much in it :-
xxx@xxx$ time awk 'NR>1 && !/^End of Report/' test >/dev/null
real 0m0.016s
user 0m0.000s
sys 0m0.010s
xxx@xxx$
xxx@xxx$
xxx@xxx$ time sed -e '/exa_resu_adj.*/d' -e '/End of Report.*/d' test >/dev/null
real 0m0.014s
user 0m0.000s
sys 0m0.010s
xxx@xxx$
xxx@xxx$ time /usr/xpg4/bin/grep -v -e 'exa_resu_adj.4g3 v.47645' -e 'End of Report Requested by: kattoor' test >/dev/null
real 0m0.013s
user 0m0.000s
sys 0m0.010s
xxx@xxx$