Parse a text string???

tomw

Active Member
All,

I am trying to parse a text string the has a comma as a delimiter but can't find the right BSFN to do the job.

I am using B05000690

Parse Text String
BC Name - Remark Explanation (F0618) -> BF szInputText
VA rpt_ParseDate_str <- BF szOutputObjectSegment
"1.00" -> BF mnSegmentNumber
"," -> BF cDelimiter

Sample of the data
Explanation -Remark-
1634398,05/04/09
1634398,05/05/09
1634398,05/06/09
1634398,05/07/09
1634398,05/08/09
353586,05/08/09
212564,05/06/09
212564,05/07/09
583672,05/04/09
583672,05/05/09
583672,05/06/09
583672,05/07/09
583672,05/08/09


Is there a better way
 
Hi Tom,

[ QUOTE ]
Is there a better way

[/ QUOTE ]

When I have to parse or compose a string with pre-defined format, then my BETTER way to create my own Business Function.

Sorry, this is not too much help for you
frown.gif


Regards,

Zoltán
 
He's right, use a custom c function and use the strtok function to break it up and then convert the tokens to JDE strings. This way you can control how many tokens you get back.
 
tomw,

Assuming the data will always be as per your example....

iInt = (length(rtrim(unparsedstring," "))-9)
firstpart = substr(unparsedstring,0,iInt)
secondpart = substr(unparsedstring,iInt,8)


Barry
 
If your usage is simple like one token at a time then standard function works fine i have not yet developed custom code for this.
It has one issue though if your string token is uneven like 100,,100 with no sring inbetween separator then it fails.

Hope this helps.

Chan
 
ooops....slight error

iInt = (length(rtrim(unparsedstring," "))-9)
firstpart = substr(unparsedstring,0,iInt)
iInt = iInt + 1
secondpart = substr(unparsedstring,iInt,8)
 
--0016364ef3d81f9e8e046ab9e3ed
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable

Hi,
use the BSFN "Parse Delimiter String".


nt
ist.com?Subject=3DUnsubscribe&Body=3DSirs,

Please++remove+this+address

--
Bindu K

--0016364ef3d81f9e8e046ab9e3ed
Content-Type: text/html; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable

<div class=3D"gmail_quote">On Sun, May 24, 2009 at 8:10 PM, peterbruce <spa n dir=3D"ltr"><<a href=3D"mailto:p[email protected]">[email protected]</a <blockquote class=3D"gmail_quote" style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0 px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Tom,


Here is another option. I wrote some ER to break up attached text. You could probably adjus t it to do parse a string. I posted it as an attachment to <a href=3D"http: //www.jdelist.com/ubb/showflat.php?&Number=3D96449#Post96449" target=3D ?Number=3D96449" target=3D"_blank">download attachment</a>).
, Oracle DB 9207, Websphere 6 Win2K3. Forms: Create!form Server 3/Server 6
<div class=3D"im">
=3DOWDEV&Number=3D146266" target=3D"_blank">entire JDELIST thread</a> i s available for viewing.
postlist.php?Cat=3D&Board=3DOpps" target=3D"_blank">Job Opportunities f <div align=3D"center"><font face=3D"Verdana, Arial" size=3D"-2">This is the JDELIST EnterpriseOne Developers Mailing List.
JDELIST is not affiliate d with JDEdwards=AE.</font></div></td></tr></tbody></table>
[email protected]?Subject=3DUnsubscribe&Body=3DSirs,

Please++remove+ this+address+from+the+JDELIST+EnterpriseOne+Developers+Mailing+List.

T hank+You." target=3D"_blank">Click here</a>. </p>


--0016364ef3d81f9e8e046ab9e3ed--
 
If your usage is simple like one token at a time then standard function works fine i have not yet developed custom code for this.
It has one issue though if your string token is uneven like 100,,100 with no sring inbetween separator then it fails.

Hope this helps.

Chan
Hi Chan,
Any workaround for this issue where blank columns are ignored by the Parse Delimited String or Parse Text String BSFN ?


Regards,
Sunny
 
You can use the standard BSFN just fine as long as your string fits inside the data structure. But, you will want to use the "Replace String" BSFN first to replace any occurrence of consecutive separators with a blank in between each separator. So, replace ",," or "||" with ", ," and "| |". Then the JDE standard parse string function will work without issue.
 
Back
Top