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 » CSV question

Post new topic  Reply to topic
 CSV question « View previous topic :: View next topic » 
Author Message
farubino
PostPosted: Tue Mar 17, 2009 4:23 am    Post subject: CSV question Reply with quote

Novice

Joined: 17 Mar 2009
Posts: 13

Hi,
i am a newbie of Message Broker. I have a flow with a csv input message. All data inside the csv are separated by a pipe('|').
The problem is that records are not in the same row in the csv. Each record can be splitted into two rows. So, it's difficult to understand if the current row parsed is a new record or is refered to the former one.
I thougth to use regular expression (Data pattern separation types) to parse the file, but i don't know if is the right choose.

This is an example of a record in my csv:

Code:

data1|data2|data3|address1|address2|address3|<CR><LF>address4|address5|
data1|data2|data3|address1|address2
data1|data2|data3|address1|address2|address3|<CR><LF>address4|address5|address6|


Thanks in advance
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Mar 17, 2009 4:37 am    Post subject: Re: CSV question Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

farubino wrote:
i am a newbie of Message Broker. I have a flow with a csv input message. All data inside the csv are separated by a pipe('|').


So you have Comma Separated Values with no commas?

farubino wrote:
The problem is that records are not in the same row in the csv. Each record can be splitted into two rows.


So potentially there's a CR/LF embedded in a row, as well as marking the end of it? Yes?

What is producing this message? What rule(s) does it use for breaking the row like this?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Mar 17, 2009 5:02 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Is there something unique about data1?
Back to top
View user's profile Send private message
farubino
PostPosted: Tue Mar 17, 2009 5:05 am    Post subject: Reply with quote

Novice

Joined: 17 Mar 2009
Posts: 13

I have done a mistake. Data in my file are separated by tag. The separator is the pipe "|".

Each record in the file identifies a person and his home addresses.
If a person has more than 5 addresses, the related record is splitted into 2 rows. The first row contains the following data:

personid|name|surname|address1|address2|address3|address4|address5

The second row contains the others addresses

address6|address7|...|addressN

I hope i'm clear.

Thanks
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Mar 17, 2009 5:38 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I don't see any tag in your data. I see pipe-separated fields.
It looks to me as if you have two kinds of line
PersonRecord, with between 4 and 8 fields separated by a pipe
ExtraAddresses, with 1..N fields. If N is always < 4 then your problem is simple. Use data patterns to detect fields which have >= 4 fields. Put both of your fields into a choice with DES="Use Data Pattern". The members of the choice will be elements 'PersonRecord' and 'ExtraAddresses' with the choice having DES="All Elements Delimited".

If ExtraAddresses can have 4 fields or more, you need a way to detect personId using a data pattern.

Please remember that the data patterns on PersonRecord and ExtraAddresses *must* match the entire line. Otherwise the group underneath the data pattern will run out of data.
Back to top
View user's profile Send private message
farubino
PostPosted: Tue Mar 17, 2009 6:01 am    Post subject: Reply with quote

Novice

Joined: 17 Mar 2009
Posts: 13

Thanks...i'll try in this way
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 » CSV question
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.