ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » pipe delimited file to xml

Post new topic  Reply to topic
 pipe delimited file to xml « View previous topic :: View next topic » 
Author Message
jr_martin
PostPosted: Tue Apr 28, 2009 7:12 pm    Post subject: pipe delimited file to xml Reply with quote

Apprentice

Joined: 24 Aug 2005
Posts: 36
Location: NY

Hi,
I am using following options to create an XML file from a delimited flat file. Based on actual output file, it looks like, I need to enforce line feed along with delimiter for record seperation. How do I achieve the expected output?

Message domain = MRM
dataElementSeparation = AllElementsDelimited
delimiter = | (PIPE)

Input File:

A1|B1|C1
D1|E1|F1
G1|H1|I1


Expected output:

<Record>
<field1>A1</field1>
<field2>B1</field2>
<field3>C1</field3>
</Record>
<Record>
<field1>D1</field1>
<field2>E1</field2>
<field3>F1</field3>
</Record>
<Record>
<field1>G1</field1>
<field2>H1</field2>
<field3>I1</field3>
</Record>

Actual Output:

<Record>
<field1>A1</field1>
<field2>B1</field2>
<field3>C1D1</field3>
</Record>
<Record>
<field1>E1</field1>
<field2>F1G1</field2>
</Record>
<Record>
<field1>H1</field1>
<field2>I1</field2>
</Record>


Environment: WMB6103@solaris, Toolkit@Windows
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Apr 29, 2009 12:36 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

This is fairly basic stuff. Please take a look in the samples gallery ( there is a CSV sample ), or search this forum for examples.
Back to top
View user's profile Send private message
jr_martin
PostPosted: Wed Apr 29, 2009 3:45 am    Post subject: Reply with quote

Apprentice

Joined: 24 Aug 2005
Posts: 36
Location: NY

Actually, I started with CSV sample. In CSV example, <CR><LF> is not enforced for for record separation. Can you tell me which attribute is causing the issue?

Thanks.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Apr 29, 2009 4:35 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Actually, I started with CSV sample
Really? I didn't know that until now.
Quote:
In CSV example, <CR><LF> is not enforced for for record separation
Not sure what you mean. CSV, by definition, consists of lines of text with the fields separated by commas. Are you claiming that the CSV sample does not work?
Back to top
View user's profile Send private message
jr_martin
PostPosted: Wed Apr 29, 2009 6:52 am    Post subject: Reply with quote

Apprentice

Joined: 24 Aug 2005
Posts: 36
Location: NY

CSV sample worked ok.I made the following modifications to that sample to process delimited file.

Messaging standard = Userdefined Text
dataElementSeparation = AllElementsDelimited
delimiter = | (PIPE)

Issue is with the field3 of record1 in the actual ouput xml file => <field3>C1D1</field3>

Why field1 of record2 (D1) is being populated in record1 of output file?
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Apr 29, 2009 7:07 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

The parser is doing exactly what you have told it to do. It is splitting up the input text using the pipe character.

Quote:
Why field1 of record2 (D1) is being populated in record1 of output file?
Because you have not defined the linefeed character(s) as a delimiter. You need *two* complex types for this, not one.

Please look carefully at the CSV message set in the sample, and try to *understand* it.
Back to top
View user's profile Send private message
jr_martin
PostPosted: Wed Apr 29, 2009 10:50 am    Post subject: Reply with quote

Apprentice

Joined: 24 Aug 2005
Posts: 36
Location: NY

Thanks, I used two complex types, it worked.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » pipe delimited file to xml
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.