Import from fixed length file
Moderators: chulett, rschirm, roy
I believe so, yes. The MKS Toolkit ships with the Enterprise Edition for Windows and brings UNIX capabilities to the table. Pretty cool stuff.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Can anybody help me on thisdxk9 wrote:
I have a file containing different row types. Each row type has different number of columns of fixed length.
Eg:
Header
AAA field1(4) field2(11) field3(6) field4(7) field5(14)
BBB field1(9) field2(1) field3(16) field4(6) field5(4) field6(10) field7(11) field8(6) field9(2) field10(14)
CCC field1(7) field2(23)
-----------------
-------------
Footer
I need to import this entire file and filter selected row types to specific destinations.
I first imported the entire row as one single field and then used different transformers to send it to different targets. I used string functions in each transformer depending on the target to get that row type separately. But this becomes very complex when there are hundreds of fields in a row type.
Is there any better way to do this??
Regards,
Divya
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Read the file using a single VarChar column.
Your file is NOT fixed-length format, which would require every record to contain the same number of characters. Specify none for the field delimiter.
Determine the record type in a Filter stage or in Transformer stage constraints and parse the separate record types using separate Column Import stages or separate output links from the Transformer stage.
Your file is NOT fixed-length format, which would require every record to contain the same number of characters. Specify none for the field delimiter.
Determine the record type in a Filter stage or in Transformer stage constraints and parse the separate record types using separate Column Import stages or separate output links from the Transformer stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
I have already imported the entire file as a single field and then separated it to various targets based on the row_type ( 1st field), Now when I try to take one of those target file(fixed length) as input and try to read it, I am not able to view the data.
The properties I set were:
Record Length = fixed
datatype for all columns as "Char"
It says:
<Sequential_File> "record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is "REC_TYPE".
"REC_TYPE" is my 1st field.
When I remove 'Record Length = fixed' property, I get the error
Input buffer overrun at field "user_id", at offset: 276
Regards,
Divya
The properties I set were:
Record Length = fixed
datatype for all columns as "Char"
It says:
<Sequential_File> "record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is "REC_TYPE".
"REC_TYPE" is my 1st field.
When I remove 'Record Length = fixed' property, I get the error
Input buffer overrun at field "user_id", at offset: 276
Regards,
Divya
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: