Reading of csv file using Seq File Stage
Moderators: chulett, rschirm, roy
Reading of csv file using Seq File Stage
Hi I want to read .csv file data using seq. file stage, but I have an issue here
Data is as follows (presume all are varchar datatypes)
100,200,300,A,"34,00","64,000","0,23"
200,200,500,B,"22,000","11,0"12,00"
Here is the issue, because the values within double quotes contains commas, it is treating as delimiter value, though it is single value
Please suggest me how to handle this
Final Delimiter=end
Field Level
Delimiter=comma
Quote=double
Thanks in advance
Data is as follows (presume all are varchar datatypes)
100,200,300,A,"34,00","64,000","0,23"
200,200,500,B,"22,000","11,0"12,00"
Here is the issue, because the values within double quotes contains commas, it is treating as delimiter value, though it is single value
Please suggest me how to handle this
Final Delimiter=end
Field Level
Delimiter=comma
Quote=double
Thanks in advance
Hianbu wrote:If you define Quote as double, then you are fine. Were you able to run your successfully?
Quote=double also I have done it before which I already mentioned in my first post.
Its not going to work, because within quotes , comma is there, which is getting treated as delimiter and my values is getting truncated
Looking for some better solution
Hianbu wrote:Your quote setting should work. Truncation problem is due to your length defined for that field. Increase your length, then you should be able to read the data.
thanks for ur reply. its not the problem with length, its varchar with no length specification.
You can check from ur end placing the same data in my first posting
it wont work if there is comma within double quotes
Really appreciate if someone can give an affective solution.
I am not expecting simple new datastage level solutions
Re: Reading of csv file using Seq File Stage
Please read my posting clearly before suggestion
I am saying comma within quotes is getting treated as delimiter which should not..THATS MY ONLY CONCERN
PLEASE DONT SUGGEST, LENGHT PROBLEM OR SOME TRUNCATION PROBLEM.
I am saying comma within quotes is getting treated as delimiter which should not..THATS MY ONLY CONCERN
PLEASE DONT SUGGEST, LENGHT PROBLEM OR SOME TRUNCATION PROBLEM.
krisp321 wrote:Hi I want to read .csv file data using seq. file stage, but I have an issue here
Data is as follows (presume all are varchar datatypes)
100,200,300,A,"34,00","64,000","0,23"
200,200,500,B,"22,000","11,0"12,00"
Here is the issue, because the values within double quotes contains commas, it is treating as delimiter value, though it is single value
Please suggest me how to handle this
Final Delimiter=end
Field Level
Delimiter=comma
Quote=double
Thanks in advance
Re: Reading of csv file using Seq File Stage
this is not the way of asking for favour... this is a professional forum, please think before you post something this.krisp321 wrote:Please read my posting clearly before suggestion
I am saying comma within quotes is getting treated as delimiter which should not..THATS MY ONLY CONCERN
PLEASE DONT SUGGEST, LENGHT PROBLEM OR SOME TRUNCATION PROBLEM.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
See if a server Sequential File stage - either in a server job or in a server shared container - can read this file properly. You can use a server shared container in a parallel job.
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.