IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
  • 1.  How extract part of filename and assign to string var

    Posted Thu October 26, 2006 06:53 PM

    Hello group.

    I need to be able to do the following and wanted to know if anyone here can help me. I have a filename that I receive that comes in a format that looks like this:

    FILExxxxx.cbkxxxx.pov

    I need to be able to extract the cbkxxxx from the file and assign it to a string variable. I have to be able to somehow say “look at the filename string, look for cbk and take the value up to the .pov and assign it to a string variable”. How do you do that in developer? Currently, I have a substring set up, but it’s possible that the position of the cbkxxxx could be different.

    Thanks.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 2.  RE: How extract part of filename and assign to string var

    Posted Thu October 26, 2006 06:58 PM

    Use pub.string:tokenize. Use . as your delim. Your cbkxxx will be in the second position in the returned valueList.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 3.  RE: How extract part of filename and assign to string var

    Posted Thu October 26, 2006 06:59 PM

    If the cbkxxxx section is always bracketed by periods one way to do this would be to tokenize (pub.string:tokenize) the file name using ‘.’ as the delimiter, then loop through the resulting string list checking for a value beginning with cbk.

    Tim


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 4.  RE: How extract part of filename and assign to string var

    Posted Fri October 27, 2006 01:31 AM

    or u can loop over the value list and as u know u have the value u need in valuelist[1] i.e in second position …just use the iterator and when it is 1 just map the value to a string and use it …
    HTH
    sri


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 5.  RE: How extract part of filename and assign to string var

    Posted Fri October 27, 2006 04:22 AM

    If the part of the name will always be in the same place, just use an index to retrieve the desired entry from the array. No need to loop.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 6.  RE: How extract part of filename and assign to string var

    Posted Mon October 30, 2006 03:59 PM

    yeah thats right …give value list as input to pub.list:getStringListItem and specify index value …u can strip off the value u want …
    HTH
    sri


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: How extract part of filename and assign to string var

    Posted Mon October 30, 2006 05:08 PM

    Hey,

    Invocation of the service is also not needed. You may just map the string list to the string and give the index on tha map step

    Rgds,
    Pradeep


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 8.  RE: How extract part of filename and assign to string var

    Posted Mon October 30, 2006 07:16 PM

    yeah thats true …solution by pradeep is pretty simple


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB