Splitting One Record to Many
Posted: Wed Apr 12, 2006 5:04 pm
Hi,
I have a file with records that carry few occurences[10] of Charges.
[1] For each of these input records with charges as an array [1-10], how do I create 10 ouput records with Charge1 in record1, charge2 in record2 and so on. What stage[s] is the best ?
[2] Again not all input records would carry all 10 charges, it might be 7, 6 or 9 charges, and this no of charges is known by another column. So if an input record has 4 charges, how do I limit to just writing 4 output records with Charge1, charge2, charge3, charge4 and not write records for zero charges.
Input:
AAAAAAAAA 5 $10 $9 $8 $7 $6 blank blank blank blank blank
Output
AAAAAAAAA $10
AAAAAAAAA $9
AAAAAAAAA $8
AAAAAAAAA $7
AAAAAAAAA $6
Just learning, and the tips learnt here, has tremendously helped me this one week. Thanks guyz. -Vijay
I have a file with records that carry few occurences[10] of Charges.
[1] For each of these input records with charges as an array [1-10], how do I create 10 ouput records with Charge1 in record1, charge2 in record2 and so on. What stage[s] is the best ?
[2] Again not all input records would carry all 10 charges, it might be 7, 6 or 9 charges, and this no of charges is known by another column. So if an input record has 4 charges, how do I limit to just writing 4 output records with Charge1, charge2, charge3, charge4 and not write records for zero charges.
Input:
AAAAAAAAA 5 $10 $9 $8 $7 $6 blank blank blank blank blank
Output
AAAAAAAAA $10
AAAAAAAAA $9
AAAAAAAAA $8
AAAAAAAAA $7
AAAAAAAAA $6
Just learning, and the tips learnt here, has tremendously helped me this one week. Thanks guyz. -Vijay