Page 1 of 1
Column Import For Fixed Width File
Posted: Mon Jul 07, 2008 5:08 am
by senthilt1
Hi All,
I have to split up my input record in to 4 columns.
My Input Seq file has a single column.
Input data is:
1234abcd9089qwer
0989mnop0909sdfg
My O/p file needs four columns, Expected o/p data is:
col1 -1234
col2 -abcd
col3 -9089
col4 -qwer
How shall i achieve this through the column import stage for the fixedwidth record.
Thanks,
SenthilP
Posted: Mon Jul 07, 2008 6:02 am
by ArndW
Declare the 4 output fixed columns and make the file format with fixed width & no column separators.
Posted: Mon Jul 07, 2008 7:25 am
by senthilt1
HI ArndW,
Thanks for your reply,
I tried it, The columns are splitted but the values are not proper.
for my given input: 1234qwer0989lkjh
The output column values are:
col1-1234
col2-0989
col3-
col4-
There is no value for col3 and col4. also col2 value is wrong.
Why the output is coming like this, i have all my output datatype as Varchar. For my single input field also i have given as varchar.
Please help me,
Thanks,
Senthil P
Posted: Mon Jul 07, 2008 7:49 am
by OddJob
If it's fixed width surely your field types need to be char??
Posted: Mon Jul 07, 2008 11:21 pm
by senthilt1
Hi,
I tried giving char to my field types, even then i dint get the output.
In col Import stage, i set Record length is Fixed and no field defaults.
For My input seq file, I set the Record length as fixed.
If i change my datatypes to char, it says that" White space Delimiter is missing at offset 4". But i never set any delimiter anywhere.
Please help to resolve this issue,
Thanks,
Senthil P
Posted: Tue Jul 08, 2008 1:07 am
by ArndW
Using "Char" was a necessary first step. It looks like you have specified delimiters in the column import file definitions, though.
Posted: Tue Jul 08, 2008 3:01 am
by senthilt1
I havent specified the delimiter anywhere, but when i use the char as my datatype for both the Input and output columns of Column import i am getting this error. "Field "col1" lacks whitespace delimiter, at offset: 4 "
Will Column Import surely work for fixed with file?
Please let me know,
Thanks,
senthil P