|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Handling CSV message |
« View previous topic :: View next topic » |
Author |
Message
|
neeha_kashyap120 |
Posted: Tue Aug 18, 2009 6:10 am Post subject: Handling CSV message |
|
|
 Apprentice
Joined: 05 Mar 2009 Posts: 31
|
Hi
I am doing a CSV -->XML transformation. The element delimiter is , and the record delimiter is <LF>. The customer is sending the message as following
Code: |
data1,data2,data3,data4,data5,<LF> |
the message is supposed to have only 5 fields but they are sending a , at the end of the 5th field. SO when its converted to XML the last field is parsed as "data5," any ideas how to handle this.
Thanks in advance
Neeha _________________ Neeharika Kashyap
IBM Certified System Administrator - WebSphere MQ V6.0
Trying to be IBM Certified System Administrator - WebSphere Message Broker V6.1 and IBM Certified Solution Developer - WebSphere Message Broker V6.1 |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Aug 18, 2009 6:14 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Change the record delimiter to ,<LF> |
|
Back to top |
|
 |
neeha_kashyap120 |
Posted: Tue Aug 18, 2009 6:21 am Post subject: |
|
|
 Apprentice
Joined: 05 Mar 2009 Posts: 31
|
Hi Jeff
I already tried that, did not work. Still the 5th field is populated as "data5,".
Neeha _________________ Neeharika Kashyap
IBM Certified System Administrator - WebSphere MQ V6.0
Trying to be IBM Certified System Administrator - WebSphere Message Broker V6.1 and IBM Certified Solution Developer - WebSphere Message Broker V6.1 |
|
Back to top |
|
 |
kimbert |
Posted: Tue Aug 18, 2009 4:44 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I already tried that, did not work. Still the 5th field is populated as "data5," |
It should have worked. I suspect that you forgot to redeploy. Can you try again, perhaps with debug-level user trace enabled so that you can see what the TDS parser is up to?
If the trailing comma is *always* in the data, mqjeff's solution will work.
If it is sometimes there and sometimes not, you have two options
a) add a 6th field with minOccurs="0", and ignore it in your flow
b) wrap the entire line in a group with GroupTerminator='',<LF>'. Set the Group Terminator for the line itself to just <LF>. Make sure that both the group and the line have maxOccurs set correctly. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|