Author |
Message
|
Hulisan08 |
Posted: Mon Jun 04, 2012 11:48 pm Post subject: Ignoring newline chars at EOF while creating MDM message Set |
|
|
Newbie
Joined: 03 Apr 2012 Posts: 6
|
Hi,
I have created a MDM message set based on tagged fixed length messages, and it works perfectly for the data provided. How ever, the external system is sending some newlines/spaces after the message contents(after the last footer element) which is causing the messageParsing to fail.
Is there a way to ignore these extra lines/spaces?
Thanks in Advance. |
|
Back to top |
|
 |
kash3338 |
Posted: Tue Jun 05, 2012 1:37 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
You can either ask the external application to remove the extra line and send the message or add another element in your message set at the end to hold the extra line and ignore during your coding. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jun 05, 2012 2:52 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
kash3338 wrote: |
You can either ask the external application to remove the extra line and send the message or add another element in your message set at the end to hold the extra line and ignore during your coding. |
Or you can read the message as blob, trim the trailing line feeds, and then parse using your message set. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jun 06, 2012 1:03 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
kash3338's solution can be implemented like this:
- Add one more sequence group ( not complex element ) as the final member of the outermost complex type.
- Set Data Element Separation to 'Use Data Pattern'
- Add a local element with name 'trailingWhitespace' to the sequence
- Set the element's minOccurs property to 0
- Set the element's Data Pattern property to ".*" ( the " are not included the value that you enter in the property )
I haven't tested this, but it should be possible to make it work.
For users of WMB v8 who might read this: The DFDL parser provides the %WSP; mnemonic for exactly this purpose. Just append %WSP; to the 'separator' property for the outermost sequence. |
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Sun May 12, 2013 10:30 pm Post subject: |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
kimbert wrote: |
For users of WMB v8 who might read this: The DFDL parser provides the %WSP; mnemonic for exactly this purpose. Just append %WSP; to the 'separator' property for the outermost sequence. |
I am on v8 and the same applies when writing to a file ?
I am building a CSV record which is modelled in a DFDL. Everything is right except the newline that is embedded between two output records. I have set separator property to %WSP;. BTW, does %WSP*; mean multiple occurrences of white-space ?
One other factor that should (probably) be considered is the FileOutput node where the CSV record flows to. Under 'Records and Elements' tab, I have set 'Record definition' as 'Record is Delimited Data' and 'Delimiter' is 'Broker System Line End'. _________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Tue May 21, 2013 8:46 am Post subject: Newline added at end of CSV record from DFDL. |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
I am writing two output records by setting different CSV fields of first, OutputRoot.DFDL.A.B and then by creating a lastChild of A with name as B. Once both these are prepared, they are propagated. I keep getting a new line after every pair of these records.
I have tried altering various settings (terminator, separator) at various level (outermost element name, sequence, etc.) with values such as %LF; %CR; %WSP*; etc. but, no luck.
How do I get around this issue ? _________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
|