Page 1 of 1

Reading problem with Sequential file

Posted: Mon Jun 09, 2008 4:58 am
by iamnagus
I have data in .csv file, this is not fixed width file.

empno should get 1,
sal should get 1,00,000
and deptno should get 11.

how to read this in sequential file stage...

empno, sal, deptno
1,1,00,000,11

Any one Plz Help me....

Posted: Mon Jun 09, 2008 5:27 am
by ameyvaidya
Assumption Made:

exactly 3 fields in file. first field is empno, last field is deptno and everything else in the middle is the salary.

Possible Solution:

Read the entire row in as one column: Col1

In a transformer, map 3 columns
EMP<--Field(DSLink2.Col1,",",1,1)
Sal<--Field(DSLink2.Col1,",", 2,Dcount(DSLink2.Col1,",")-2)
Deptno,--- Field(DSLink2.Col1,",", Dcount(DSLink2.Col1,","),1)


Unable to test this though.. No PX available.

Posted: Mon Jun 09, 2008 7:15 am
by balajisr
Better, change your file format. Your file does not seems to be valid for the given metadata.

Posted: Mon Jun 09, 2008 9:28 am
by rager
You would only be able to read this file successfully, without errors, if the you know the length of the empno and deptno field and it is fixed.
I would suggest changing the format of the file.