Page 1 of 1

File Delimeter

Posted: Thu Dec 17, 2009 11:09 pm
by vinsashi
Hi,
my source file is comma delemeter. and data i have like this

Code: Select all

pdid,pdcost,pdnm
a001,10,000,XXX
b001,20,000,YYY
c001,1,00,000,ZZZ
when i am reading in sequntial file i am getting wrong data
under pdcost.underproduct cost i wil get data like this
10,000
20,000
1,000,000
In windows environment i am working..

Thanks
Vin...

Posted: Fri Dec 18, 2009 2:44 am
by vinsashi
Any help on this

Posted: Fri Dec 18, 2009 3:06 am
by ray.wurlod
Learn patience. The rest of the world does not work on Indian Standard Time.

Further, the rules for producing the output are not well (clearly) stated. Try to come up with a specification in English about how each target row is to be produced from its corresponding source row.

You might also answer why you have three column headings but four or five columns in your data rows.

Posted: Fri Dec 18, 2009 3:26 am
by Sainath.Srinivasan
Looking at the data and using my interpretation of your requirement...

the numeric value pdcost has comma separation for its units and so are your fields. Hence the confusion.

Use a different field separator.

Posted: Fri Dec 18, 2009 3:38 am
by gssr
For this situation,
Read the file as fixed lengh field and then try to solve the delimiter issue in transformation

Hope it works!

Posted: Fri Dec 18, 2009 4:57 am
by Sainath.Srinivasan
File is not fixed length.

You can read as single variable length field and work from there..

Posted: Fri Dec 18, 2009 8:12 am
by chulett
You've been supplied an invalid csv file. Those amounts need to be quoted so they can be properly read, that or they should not have those internal commas.

Code: Select all

pdid,pdcost,pdnm 
a001,"10,000",XXX 
b001,"20,000",YYY 
c001,"1,00,000",ZZZ

Code: Select all

pdid,pdcost,pdnm 
a001,10000,XXX 
b001,20000,YYY 
c001,100000,ZZZ