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
Expand all | Collapse all

Distinguish character in a field from field delimiter character of a record using webMethods

  • 1.  Distinguish character in a field from field delimiter character of a record using webMethods

    Posted Tue March 17, 2015 01:52 AM

    We have a requirement where we have to parse impex file (CSV format) using webMethods . It is a semicolon delimited record .But there is a possibility that the fields can also have “;” as part of the data and not an a delimiter. How can the data “;” distinguished from field delimiter of the record

    For example :
    Sample Record :

    ;0001;10011;pieces;CAREXXXXXXXXXX;;The CAREXXXXXXXXXX DRX-1 System offers a quick, easy and affordable way to transition to digital radiography. Based on the unique X-Factor platform, a wireless DR detector simply slides into existing x-ray equipment and can be used with imaging systems throughout your facility. Some use word processor; others DR detector or x-ray equipment The detector is also the center point of the XXXXX Family–a complete line of innovative DR systems including full radiology rooms and mobile x-ray systems.;;

    Here the highlighted line with “;” is part of the product description field and not a delimiter .
    Kindly share your idea on how to handle this scenario using webMethods .


    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Distinguish character in a field from field delimiter character of a record using webMethods

    Posted Wed March 18, 2015 01:45 PM

    Hi,

    Is this exactly what you receive? Or do you receive on another format and it is translated to csv afterwards?
    Is there a way to avoid having semicolons on the file (or use another separator)?
    The extra semicolons always appear on the same field?

    Default CSV handlers on IS (and Excel) use a escape character on those cases (usually "").

    If you can guarantee that the file with X fields per line/record has one and only one field (the Yth field) with semicolons, you could have some code doing:

    For all lines

    1. does the line has more than X fields?
    2. Yes - > let Z = fields - X; join fields Y, Y+1, … Y+Z with an escaped semicolon
    3. save line for processing

    Process lines saved.

    Hope it helps.

    Best Regards,


    #Integration-Server-and-ESB
    #webMethods