Author |
Message
|
suraj |
Posted: Tue May 13, 2008 6:34 am Post subject: trailing spaces in TDS mesasge |
|
|
Acolyte
Joined: 31 Jul 2007 Posts: 56
|
Hi
I have a file that has numner of pipe delimited records. It looks like
gfgdfg|sgg|sgs|1343|
sfsdgg|sdg|sdf|1434|
But after the last "|" there are some blank spaces for each record.
I am reading this file using the fileInput node and have a TDS message def for this.
The problem is the spaces, the file fails to parse , the exception saying "not all buffer used while reading".
Without the spaces after the record, the flows works fine.
So how can i avoid those trailing spaces while parsing the file ? |
|
Back to top |
|
 |
broker_new |
Posted: Tue May 13, 2008 6:42 am Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
For first line.
Create a type Type1 and add all the elements under that Type1.
Create one more type Type 2 and add all the elements under that Type2.
For Type1 Select DataElementSeparation as All elements Delimited and mention delimiter as (|).
Do the same thing for Type2 too.
Create one more type called Type 3 and add create two child elements under that and for first element create the reference to Type1 and for second element refer to Type 2.
For Type3 Select DataElementSeparation as All elements Delimited and mention delimiter as (<LF>).
Refer this Type3 type in messages. _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
suraj |
Posted: Tue May 13, 2008 6:51 am Post subject: |
|
|
Acolyte
Joined: 31 Jul 2007 Posts: 56
|
thnks,
i have modeled the message the same way.
Type1 with DataElementSeparation as all elements delimited by | and group terminator as |, cause i have | at end of each record.
Type2 has an element of type1 which occurs from 1 to -1(since my file as many reords), and delimited by LF.
And the Message is of type2.
But this does not work. |
|
Back to top |
|
 |
kimbert |
Posted: Tue May 13, 2008 7:01 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
But this does not work. |
What can broker_new, or anybody else, do with that information? Either describe the problem properly, or don't bother to mention it.
Have you tried taking a user trace to see what the parser is doing? |
|
Back to top |
|
 |
suraj |
Posted: Tue May 13, 2008 7:17 am Post subject: |
|
|
Acolyte
Joined: 31 Jul 2007 Posts: 56
|
I have already described the problem in my post.
The problem is that each record has some trailing spaces at the end. And the parsing fails because of this.
I have also mentioned how did i model the message.
So how do i make the parser ignore the trailing spaces at the end of the records. |
|
Back to top |
|
 |
broker_new |
Posted: Tue May 13, 2008 7:24 am Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
You should not mention the GroupTerminator in your scenario it is simple straight forward configuration. _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
suraj |
Posted: Tue May 13, 2008 7:42 am Post subject: |
|
|
Acolyte
Joined: 31 Jul 2007 Posts: 56
|
hm... i had tried this..but in this case the last element has an value with | as the last byte.
Each record ends with |. So i had the group terminator there.
I guess.. i will add an extra element to the defination... and just neglect this after the parsing. this may not be the correct way ..but it will certainly help...
Thanks for your help. |
|
Back to top |
|
 |
|