Page 1 of 1

Reading from sequential file

Posted: Wed Aug 13, 2008 11:56 pm
by Roopanwita
HI,
We have input file as follows:

Code: Select all

XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION  
      
, we have to read the records from 5 column name (col1,col2,col3,col4,col5).
Can anybody suggest how to read the file.
WE have tried with fixed width column option , but all columns doesn't have same length,so it not working.
Also tried COlumn Importer stage ,but we are not getting desired results..
that for col2 , some part of col3 is getting attached to col2.

Thanks in Advance!

Posted: Thu Aug 14, 2008 12:21 am
by ray.wurlod
Import the table definition for the Sequential file. Check the "fixed-width format" and specify the column widths in the field provided, or in the Columns grid (as Display Width) on the Define tab. Use this table definition in your job.

To retrofit the same, you need to alter the display width property of each field in the table definition in the Repository, or within your job design. The latter method is less than best practice.

Posted: Thu Aug 14, 2008 12:57 am
by Roopanwita
Thanks !
It is working fine now :lol:

Re: Reading from sequential file

Posted: Wed Aug 20, 2008 12:27 am
by bikan
Roopanwita wrote:HI,
We have input file as follows:

Code: Select all

XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION 
XXX XXXXXXX                            YYY YY YYYYY AAAAAA AAAA      WWW_WWW_WWW   WW     DESCRIPTION  
      
, we have to read the records from 5 column name (col1,col2,col3,col4,col5).
Can anybody suggest how to read the file.
WE have tried with fixed width column option , but all columns doesn't have same length,so it not working.
Also tried COlumn Importer stage ,but we are not getting desired results..
that for col2 , some part of col3 is getting attached to col2.

Thanks in Advance!
HI
one way is write the whole file into .csv file target and delete the unwanted columns.
Vasudev

Posted: Wed Aug 20, 2008 7:21 am
by chulett
There was no mention of 'unwanted' columns, they just needed to know how to read a fixed-width file. And to write it in csv format, you'd still need to read it first. :wink: