Hi everybody.
I need to find a solution to read a complex file, delimited by ';'.
Imagine the following layout:
Document;QuantityPhone;PhoneNumber;PhoneNumberArea;QuantityEmail;Email;EmailStatus
111111;1;8888-8888;11;1;test@test.com;Valid
222222;2;7777-7777;11;6666-6666;11;1;test@test.com;Valid
333333;3;6666-6666;11;5555-5555;11;4444-4444;11;2;test@test.com;Valid;test2@test.com;Valid
In other words, when fields value "QuantityPhone" and "QuantityEmail" are greater than 1, the group of fields related to "Phone" and "Email" are presented as new columns.
So, each line/register can have different number of columns. It is a dynamic delimited file.
I thought we could use CFF object (Complex Flat File) however I guess it is appropriated to positional columns instead of delimited ones.
Could anybody give me some help or any tip about how reading this complex file?
Thanks In advance.
Best regards.
[Complex Flat File] Reading Complex Delimited File
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 298
- Joined: Tue Aug 26, 2008 12:17 pm
[Complex Flat File] Reading Complex Delimited File
Joyce A. Recacho
São Paulo/SP
Brazil
São Paulo/SP
Brazil
Yeah, that stage is expecting to process positional mainframe COBOL files but what you've got there is basically a couple of "OCCURS DEPENDING ON" clause situations. What do you want to do with the dynamic elements of the data, turn each one into a new record with the same common/leading data fields? We'd be talking about some kind of a horizontal pivot then of columns to rows, it would seem. Not exactly sure how you'd serve that dish quite yet but let's set the table first. What's the goal / requirement here? Can you detail the desired output?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers