Author |
Message
|
madi |
Posted: Fri Jun 27, 2008 6:54 am Post subject: csv null escape character |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
i have csv msg set defined. i get the msg in as csv and doing some translation after that
i have the csv file defined with escape character as quote
i get an error because its not able to parse it correctly here is the error
Code: |
(0x01000000):ConversionException = (
(0x03000000):File = 'F:\build\S600_P\src\cpi\bsutils\datacnv.cpp'
(0x03000000):Line = 606
(0x03000000):Function = 'DataCnv::StrToInt64'
(0x03000000):Type = ''
(0x03000000):Name = ''
(0x03000000):Label = ''
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 5505
(0x03000000):Text = 'CPI Converter Input Data Invalid'
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'string'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'No|c. About the same|3' |
if i dont have the escape char defined i get this in the output
"UNPLANNED_MAINTENANCE"
which makes sense coz its not escaping the "
what am i doing wrong?
--madi _________________ IBM Certified Solutions Developer - WMB 6.0 |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jun 27, 2008 7:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
ESQL uses the single quote as a string delimiter.
Your choice of an escape char is not a good one. You'd be better off with the \ as escape char.
You did not specify the type of your output. From the exemple we can infer that your output is either in XML or HTML format.
As such " for the quote is a legitimate value as it is going to be rendered as a quote.
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
madi |
Posted: Fri Jun 27, 2008 7:46 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
here is my input message ........ i am not using esql to escape the " i thought it will be escaped but the MRM parser just like the sample does?
Code: |
481880|"111274"|"802-1013951"|""|"UNPLANNED_MAINTENANCE"|"RANDY"|3|4|4|3|4|3|3|"No"|"c. About the same"|3|3|3||"NO"|2008-06-19 14:32:00|""|""|""|"AW"|1033491
|
_________________ IBM Certified Solutions Developer - WMB 6.0 |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jun 27, 2008 7:52 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Well it looks like the quotes are being interpreted as part of the field contents.... Review your message definition...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
madi |
Posted: Fri Jun 27, 2008 8:08 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
thats my point .................. if i give the escape character, its escaping the " but giving me the exception
if i dont give the escape character, its putting the quotes in my output
also, the same thing will happen when creating an output csv file, how do i get it to put quotes in for text fields??
thanks
madi _________________ IBM Certified Solutions Developer - WMB 6.0 |
|
Back to top |
|
 |
madi |
Posted: Mon Jun 30, 2008 5:29 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
does anyone have any ideas on how to define a CSV with quotes around the char fields in MRM??
Thanks
madi _________________ IBM Certified Solutions Developer - WMB 6.0 |
|
Back to top |
|
 |
kimbert |
Posted: Mon Jul 07, 2008 4:40 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You cannot use the 'Escape character' property to handle CSV-style quoting. It only allows you to escape a single character.
The v6.1 samples gallery contains an excellent sample about CSV. There may well be a DeveloperWorks article containing the same info. |
|
Back to top |
|
 |
|