Hi All,
I have a requirement where I need to generate multiple records for each record with addition of two columns.
EXAMPLE:
Input:
COL1,COL2,COL3
SAM,VICTOR,09/08/2006
BEN,THOMAS,06/05/2006
JOHN,RHYS,08/07/2005
Output:
COL1,COL2,COL3,COL4,COL5
SAM,VICTOR,09/08/2006,1,I.D
SAM,VICTOR,09/08/2006,2,I.B
SAM,VICTOR,09/08/2006,3,I.C
BEN,THOMAS,06/05/2006,1,I.D
BEN,THOMAS,06/05/2006,2,I.B
BEN,THOMAS,06/05/2006,3,I.C
JOHN,RHYS,08/07/2005,1,I.D
JOHN,RHYS,08/07/2005,2,I.B
JOHN,RHYS,08/07/2005,3,I.C
The file is csv file. I need to add two columns with default values to the respective record.For each record I need to add 1,2,3 in col4 and I.D,I.B,I.C in col5. I am not really good at unix scripting.But I think this can be done through scripting.If it is possible how can I proceed to write a script(mean basic idea).Hope I am clear with my question.
Thanks in advance,
Kumari
I have a requirement where I need to generate multiple records for each record with addition of two columns.
EXAMPLE:
Input:
COL1,COL2,COL3
SAM,VICTOR,09/08/2006
BEN,THOMAS,06/05/2006
JOHN,RHYS,08/07/2005
Output:
COL1,COL2,COL3,COL4,COL5
SAM,VICTOR,09/08/2006,1,I.D
SAM,VICTOR,09/08/2006,2,I.B
SAM,VICTOR,09/08/2006,3,I.C
BEN,THOMAS,06/05/2006,1,I.D
BEN,THOMAS,06/05/2006,2,I.B
BEN,THOMAS,06/05/2006,3,I.C
JOHN,RHYS,08/07/2005,1,I.D
JOHN,RHYS,08/07/2005,2,I.B
JOHN,RHYS,08/07/2005,3,I.C
The file is csv file. I need to add two columns with default values to the respective record.For each record I need to add 1,2,3 in col4 and I.D,I.B,I.C in col5. I am not really good at unix scripting.But I think this can be done through scripting.If it is possible how can I proceed to write a script(mean basic idea).Hope I am clear with my question.
Thanks in advance,
Kumari