Duplicate records based on col's data
Posted: Fri Nov 08, 2013 12:24 pm
Hello All,
I have a task to duplicate/repeat records in a file based on a particular column. All columns are separated by "|". This particular column has codes that are separated by commas.
As an example, if there are three codes on one record, that record should be outputted three times, with the code in the first position. See below. Thanks in advance for any help.
Example
Input record
Field1 | Field2 | Field3 | 9, 8, 7
Output Records
9 | Field1 | Field2 | Field3
8 | Field1 | Field2 | Field3
7 | Field1 | Field2 | Field3
I have a task to duplicate/repeat records in a file based on a particular column. All columns are separated by "|". This particular column has codes that are separated by commas.
As an example, if there are three codes on one record, that record should be outputted three times, with the code in the first position. See below. Thanks in advance for any help.
Example
Input record
Field1 | Field2 | Field3 | 9, 8, 7
Output Records
9 | Field1 | Field2 | Field3
8 | Field1 | Field2 | Field3
7 | Field1 | Field2 | Field3