Hello,
I have the following input...
(continuous line; Field Separator=,)
AAAAAA,1,1,10.0,0,46,3,3/46,15.33,4.60,20.0,0,0,BBBBBB,1,1,9.0,1,29,2,2/29,14.50,3.22,27.0,0,0,CCCCCC,1,1,8.0,1,33,2,2/33,16.50,4.12,24.0,0,0,DDDDDD,1,1,9.0,0,47,2,2/47,23.50,5.22,27.0,0,0,EEEEEE,1,1,5.0,0,20,1,1/20,20.00,4.00,30.0,0,0,FFFFFF,1,1,5.0,0,23,1,1/23,23.00,4.60,30.0,0,0,GGGGGG,1,1,6.0,0,27,1,1/27,27.00,4.50,36.0,0,0,HHHHHH,1,1,10.0,1,30,1,1/30,30.00,3.00,60.0,0,0,IIIIII,1,1,6.0,1,35,1,1/35,35.00,5.83,36.0,0,0,JJJJJJ,1,1,8.5,1,40,1,1/40,40.00,4.52,53.0,0,0,KKKKKK,1,1,10.0,0,42,1,1/42,42.00,4.20,60.0,0,0,LLLLLL,1,1,2.0,0,8,0,-,-,4.00,-,0,0,MMMMMM,1,1,10.0,0,37,0,-,-,3.70,-,0,0,
In this example the 8th field (starting at AAAAAA) is 3/46. I need to insert a 9th field which will be a duplicate of the 8th field. Similarly, the 8th field (starting count at BBBBBB) is 2/29. This must be duplicated and inserted as the next field. And so on...
Use of sed, awk, or any combination thereof is fine. Thanks for the help.
Arun
I have the following input...
(continuous line; Field Separator=,)
AAAAAA,1,1,10.0,0,46,3,3/46,15.33,4.60,20.0,0,0,BBBBBB,1,1,9.0,1,29,2,2/29,14.50,3.22,27.0,0,0,CCCCCC,1,1,8.0,1,33,2,2/33,16.50,4.12,24.0,0,0,DDDDDD,1,1,9.0,0,47,2,2/47,23.50,5.22,27.0,0,0,EEEEEE,1,1,5.0,0,20,1,1/20,20.00,4.00,30.0,0,0,FFFFFF,1,1,5.0,0,23,1,1/23,23.00,4.60,30.0,0,0,GGGGGG,1,1,6.0,0,27,1,1/27,27.00,4.50,36.0,0,0,HHHHHH,1,1,10.0,1,30,1,1/30,30.00,3.00,60.0,0,0,IIIIII,1,1,6.0,1,35,1,1/35,35.00,5.83,36.0,0,0,JJJJJJ,1,1,8.5,1,40,1,1/40,40.00,4.52,53.0,0,0,KKKKKK,1,1,10.0,0,42,1,1/42,42.00,4.20,60.0,0,0,LLLLLL,1,1,2.0,0,8,0,-,-,4.00,-,0,0,MMMMMM,1,1,10.0,0,37,0,-,-,3.70,-,0,0,
In this example the 8th field (starting at AAAAAA) is 3/46. I need to insert a 9th field which will be a duplicate of the 8th field. Similarly, the 8th field (starting count at BBBBBB) is 2/29. This must be duplicated and inserted as the next field. And so on...
Use of sed, awk, or any combination thereof is fine. Thanks for the help.
Arun