on 03-03-2014 6:06 PM
I am loading a data file using Hana Studio. The data file is four fields, all of them NVARCHAR. The data comes from a Teradata database.
Some of the records' field values have double quotes. There are also commas, and for this reason the data file uses a pipe ('|') as the record delimiter.
When I import using either a control file or using a SQL import command from Hana Studio, I specify that the record delimiter is '|'.
Some of the records load, and some fail. The failed records show up in the error log as 'Parsing error after 'xxx' column. The error record indicates that the problem is in the space right after the double quote mark.
Other details:
Parsing error: incorrect delimiter for the next column of PRODUCT_DESC field: "100"
12345 |Product xyz - "100" Daily|0A1234ZZ|"100" Daily
^
I have tried loading with and without the 'optionally enclosed by '"' '. Same result.
What am I doing wrong?
Thanks
Adding to what jake said, try using sed to command to replace the unwanted characters.
And try using this:
sed -e 's/"/\\"/g
In the CTL file:
optionally enclosed by '\"'
And check if it works.
Regards,
Krishna Tangudu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Krishna,
i saw your solution about the parsing error when loading csv files that contain double quotes.
I want to know how and where i have to use the command :
sed -e 's/"/\\"/g
Thank you very much
Regards
Pierre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.