|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Parsing User Defined Text with variable tag delimitor |
« View previous topic :: View next topic » |
Author |
Message
|
jborella |
Posted: Tue Apr 13, 2010 4:50 am Post subject: Parsing User Defined Text with variable tag delimitor |
|
|
Apprentice
Joined: 04 Jun 2009 Posts: 26
|
Suppose You have a message where the first letter in the message is the tag delimiter to use, when parsing a CSV-like text (I say like, because CSV always uses ',' as the delimiter).
For instance
|abc|def
Would specify '|' as delimiter, and thus this line would be a message with two elements 'abc' and 'def'.
My problem is, that I can't see any way to change the delimiter at runtime. I've tried different things with no luck. Nearest shot was to define the Messaging standard as HL7 and interpret the first element as 'HL7 Field Separator', but it couldn't parse dynamically, only write. Furthermore I'm under the impression, that HL7 is a specific format for healthcare, so I might run into restrictions later. I would prefer to use 'User Defined Text' as the messaging standard. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Apr 13, 2010 5:29 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
MRM can't handle dynamically determined delimiters.
This is for example why MIME is a separate domain.
If you need to process this file, and do not feel up to writing your own custom parser, you can use ESQL or Java to manipulate the message data when read as BLOB to extract the first character, and then REPLACE all occurences of it with a known, fixed character.
That is, turn all instances of "|" into "," and then use the CSV samples. |
|
Back to top |
|
 |
jborella |
Posted: Tue Apr 13, 2010 5:56 am Post subject: |
|
|
Apprentice
Joined: 04 Jun 2009 Posts: 26
|
Okay. Thanks for the answer. Then I know at least which way to work. |
|
Back to top |
|
 |
maesbrae |
Posted: Tue Apr 13, 2010 5:56 am Post subject: |
|
|
Novice
Joined: 03 Jun 2003 Posts: 12
|
Or just use ESQL to split the record up with Substring using the first character as the delimiter |
|
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
|
|
|
|