|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
DFDL CSV Parsing |
« View previous topic :: View next topic » |
Author |
Message
|
seeknee |
Posted: Tue Mar 22, 2016 12:11 pm Post subject: DFDL CSV Parsing |
|
|
 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 |
|
 |
Vitor |
Posted: Tue Mar 22, 2016 12:20 pm Post subject: Re: DFDL CSV Parsing |
|
|
 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 |
|
 |
timber |
Posted: Tue Mar 22, 2016 12:21 pm Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
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
|
|
|
|