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 » DFDL CSV Parsing

Post new topic  Reply to topic
 DFDL CSV Parsing « View previous topic :: View next topic » 
Author Message
seeknee
PostPosted: Tue Mar 22, 2016 12:11 pm    Post subject: DFDL CSV Parsing Reply with quote

Apprentice

Joined: 08 Aug 2002
Posts: 41
Location: Melbourne, Australia

Hi All

Env - WMB 8.0.0.4

Does anyone know of a way to parse the the following data using the DFDL CSV model.

0, "WUU ,abc",1.0

There are only 3 fields (0 is the header indicator, "WUU, abc" is a message type, and 1.0 is the version)

There is a space before "WUU ,abc"... If we remove the space it works.

Trying to get the CSV to parse with and without the space

Many thanks
_________________
IBM Certified Specialist MQSeries
IBM Certified Specialist WebSphere MQ Integrator
IBM Certified Solution Designer WebSphere Business Integration Message Broker V5

"Good judgement comes from experience, and experience comes from poor judgement"
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Mar 22, 2016 12:20 pm    Post subject: Re: DFDL CSV Parsing Reply with quote

Grand High Poobah

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

seeknee wrote:
There is a space before "WUU ,abc"... If we remove the space it works.


What's the error when it doesn't work?

What does the DFDL trace show when it doesn't work? What does DFDL think that space represents, and why is that a problem for it?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
timber
PostPosted: Tue Mar 22, 2016 12:21 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

The double quotes, if present, must enclose the entire field value. In your case, the delimiter ( comma ) is followed by a space character that is not data and is not a delimiter. In my opinion, that's lazy formatting by whatever is outputting the CSV.

If you want to handle this in your DFDL model then
- find the element called 'record'
- locate the sequence group within it
- Change the delimiter from "," to "%WSP*,%WSP*"

This will cause any white space before or after a comma to be treated as part of the delimiter. Make sure to test all the edge cases in the DFDL Test Parse perspective before deploying.
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 » DFDL CSV Parsing
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.