Desired Format !

Hi everybody,

I just need desired ouput from text file which should have folowing format;

"2007-06-25 00:03:32.926+05:30",12354369,"Load","Completed","Rs.-5,556.00",9452217714
"2007-06-25 00:06:57.357+05:30",12354371,"Load","Completed","Rs.-56.00",9415766266
"2007-06-25 00:10:12.193+05:30",12354373,"Load","Completed","Rs.-56.00",9452265924
"2007-06-25 00:14:09.609+05:30",12354381,"Load","Completed","Rs.-112.00",9415732860
"2007-06-25 00:14:41.411+05:30",12354383,"Load","Completed","Rs.-56.00",9413024237
"2007-06-25 00:15:10.034+05:30",12354385,"Load","Completed","Rs.-562.00",9450526212
"2007-06-25 00:17:35.331+05:30",12354389,"Load","Completed","Rs.-787.00",9450859494
"2007-06-25 00:18:15.653+05:30",12354393,"Load","Completed","Rs.-56.00",9415732860
"2007-06-25 00:21:04.704+05:30",12354399,"Load","Completed","Rs.-225.00",9460154929
"2007-06-25 00:22:20.058+05:30",12354403,"Load","Completed","Rs.-225.00",9413521298

And coming to contents of text file are as follows;

"Date","Trans ID","MSISDN","Name","Type","State","Amount","Target MSISDN","Target Name","Pre Balance","Post Balance","IN Result","Result"
"2007-06-25 00:03:13.61+05:30",12354367,9414080537,,"Balance","Completed",,,,,,,
"2007-06-25 00:03:32.926+05:30",12354369,9450950953,"RAJESH KUMAR","Load","Completed","Rs.-5,556.00",9452217714,,"Rs.1,877.00","Rs.1,821.00",,
"2007-06-25 00:06:57.357+05:30",12354371,9452381188,"Pankaj Mansinghwani","Load","Completed","Rs.-56.00",9415766266,,"Rs.1,287.00","Rs.1,231.00",,
"2007-06-25 00:10:12.193+05:30",12354373,9450942637,"Om prakash","Load","Completed","Rs.-56.00",9452265924,,"Rs.1,016.00","Rs.960.00",,
"2007-06-25 00:10:54.813+05:30",12354375,9417730005,,"Change PIN","Rolled Back",,,,,,,"Auth Retry Exceed"
"2007-06-25 00:12:08.841+05:30",12354377,9417730005,,"Balance","Rolled Back",,,,,,,"Auth Retry Exceed"
"2007-06-25 00:13:27.06+05:30",12354379,9417730005,,"Load","Rolled Back",,,,,,,"Auth Retry Exceed"
"2007-06-25 00:14:09.609+05:30",12354381,9452394267,"SAHID RASOOL","Load","Completed","Rs.-112.00",9415732860,,"Rs.1,338.00","Rs.1,226.00",,

And i have fired the following command;

grep '"Load","Completed"' 2007-06-25_Transaction_1.txt | sed 's/,,$//g' | cut -d"," -f1,2,5-8 | head

But i am not getting concern output;

"2007-06-25 00:03:32.926+05:30",12354369,"Load","Completed","Rs.-5,556.00",missingsomecolumn
"2007-06-25 00:06:57.357+05:30",12354371,"Load","Completed","Rs.-56.00",9415766266
"2007-06-25 00:10:12.193+05:30",12354373,"Load","Completed","Rs.-56.00",9452265924
"2007-06-25 00:14:09.609+05:30",12354381,"Load","Completed","Rs.-112.00",9415732860
"2007-06-25 00:14:41.411+05:30",12354383,"Load","Completed","Rs.-56.00",9413024237
"2007-06-25 00:15:10.034+05:30",12354385,"Load","Completed","Rs.-562.00",9450526212
"2007-06-25 00:17:35.331+05:30",12354389,"Load","Completed","Rs.-787.00",9450859494
"2007-06-25 00:18:15.653+05:30",12354393,"Load","Completed","Rs.-56.00",9415732860
"2007-06-25 00:21:04.704+05:30",12354399,"Load","Completed","Rs.-225.00",9460154929
"2007-06-25 00:22:20.058+05:30",12354403,"Load","Completed","Rs.-225.00",9413521298

Could you pls help me on this at the earliest?

Best Regards!
Prasanth Babu

While a csv file can understand to ignore a comma inside quotes, grep will not.
....,"Rs.-5,556.00",....

The grep command will parse this as two fields.

Hence, the missing entry.