Your file is, therefore, NOT fixed width. Specify that your file has two fields, one a Char field 19 characters long, the other a suitably large or even unbounded VarChar.
In a Transformer parse the first field into specific fields using substring techniques. Process the delimited list using (for example) looping within the Transformer stage. Depends, really, on what you want to do with these values.
FIle extract Issues
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 58
- Joined: Mon Dec 14, 2015 3:16 pm
- Location: Arizona
1. Read the whole one in one big field, field length long enough to capture the longest line.
2. use sub string function to split 1 to 18th field, use the '[ ]' operator
3. for the 19th field, split the value though field() function, using ',' as field separator.
If the sub-field count (comma delimitered ) is not fix, pivot stage can help to convert field to rows -- by principle 3rd normal form, the sub-field values in 19th field should be in another table.
2. use sub string function to split 1 to 18th field, use the '[ ]' operator
3. for the 19th field, split the value though field() function, using ',' as field separator.
If the sub-field count (comma delimitered ) is not fix, pivot stage can help to convert field to rows -- by principle 3rd normal form, the sub-field values in 19th field should be in another table.
-
- Participant
- Posts: 58
- Joined: Mon Dec 14, 2015 3:16 pm
- Location: Arizona
What do you mean by 19th field should be in another table? Could you please be bit clear. What i did right now is bought the file record as two fields, one from 1-18 and 19th, And in transformer I separated 1-18 fields using [], and now i want to do this,
How to implement this logic, because ,comma is separated the values in the last field, and there might be three, four so on values in the last fields.
Code: Select all
1001430016 107S2 D2 19,20,
1001430016 1 07 S 2 D2 19
1001430016 1 07 S 2 D2 20
anudpETL
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: