Thanks for the tip.But u just made me more interested in sed.
how will we do this then
The File looks like this
5012001,100,AUTOBATCH,FEE,DAILYFEE,0,0
4241 SERVICE DENIED
5012002,100,AUTOBATCH,FEE,DAILYFEE,0,0
4241 SERVICE DENIED
5012003,100,AUTOBATCH,FEE,DAILYFEE,0,0
4241 SERVICE DENIED
5012001,100,AUTOBATCH,FEE,DAILYFEE,0,0
2001 DIAMETER SUCCESS
5012002,100,AUTOBATCH,FEE,DAILYFEE,0,0
2001 DIAMETER SUCCESS
5012003,100,AUTOBATCH,FEE,DAILYFEE,0,0
2001 DIAMETER SUCCESS
5012001,100,AUTOBATCH,FEE,DAILYFEE,0,0
2001 DIAMETER SUCCESS
5012002,100,AUTOBATCH,FEE,DAILYFEE,0,0
2001 DIAMETER SUCCESS
5012003,100,AUTOBATCH,FEE,DAILYFEE,0,0
and i want the following output (containing numbers starting with only 50 in the first line have error code 4241 in the next line and thrid line containing number starting with 50 and fourth line having code 2001)
5012001,100,AUTOBATCH,FEE,DAILYFEE,0,0
4241 SERVICE DENIED
5012001,100,AUTOBATCH,FEE,DAILYFEE,0,0
2001 DIAMETER SUCCESS
5012002,100,AUTOBATCH,FEE,DAILYFEE,0,0
4241 SERVICE DENIED
5012003,100,AUTOBATCH,FEE,DAILYFEE,0,0
2001 SERVICE DENIED
Thanks
Pistachio