Managing sequence to make unique record
Hi Everyone,
Using shell script i am getting final file as attached below. In this 4th column value should be unique using any sequence.
for instance I've 1_13020_SSGM which is appearing 6 times in file and i should change it like 1_13020_SSGM_1,1_13020_SSGM_2,....1_13020_SSGM_6.
Can someone please provide some idea on this?
Input file
05112009,601,Excel,1_13020_DWS,1,999001
05112009,601,Excel,1_11020_SSGM,1,999001
05112009,601,Excel,1_13020_SSGM,1,999001
05112009,601,Excel,1_13020_SSGM,1,999001
05112009,601,Excel,1_13020_SSGM,1,999001
05112009,601,Excel,1_13020_SSGM,1,999001
05112009,601,Excel,1_13020_SSGM,1,999001
05112009,601,Excel,1_13020_SSGM,1,999001
05112009,601,Excel,1_13020_NEWE,1,999001
05112009,601,Excel,1_13020_NEWE,1,999001
05112009,601,Excel,1_13020_NEWE,1,999001
05112009,601,Excel,1_13020_NEWE,1,999001
05112009,601,Excel,1_13020_NEWE,1,999001
05112009,601,Excel,1_11020_NEWE,1,999001
05112009,601,Excel,1_11020_DWS,1,999001
05112009,601,Excel,1_11020_DWS,1,999001
05112009,601,Excel,1_11020_DWS,1,999001
05112009,601,Excel,1_11020_DWS,1,999001
Output file
05112009,601,Excel,1_13020_DWS_1,1,999001
05112009,601,Excel,1_11020_SSGM_1,1,999001
05112009,601,Excel,1_13020_SSGM_1,1,999001
05112009,601,Excel,1_13020_SSGM_2,1,999001
05112009,601,Excel,1_13020_SSGM_3,1,999001
05112009,601,Excel,1_13020_SSGM_4,1,999001
05112009,601,Excel,1_13020_SSGM_5,1,999001
05112009,601,Excel,1_13020_SSGM_6,1,999001
05112009,601,Excel,1_13020_NEWE_1,1,999001
05112009,601,Excel,1_13020_NEWE_2,1,999001
05112009,601,Excel,1_13020_NEWE_3,1,999001
05112009,601,Excel,1_13020_NEWE_4,1,999001
05112009,601,Excel,1_13020_NEWE_5,1,999001
05112009,601,Excel,1_11020_NEWE_1,1,999001
05112009,601,Excel,1_11020_DWS_1,1,999001
05112009,601,Excel,1_11020_DWS_2,1,999001
05112009,601,Excel,1_11020_DWS_3,1,999001
05112009,601,Excel,1_11020_DWS_4,1,999001
Thanks in advance.