IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  Parsing Unordered Text File

    Posted Wed October 27, 2010 07:45 AM

    Originally posted by: SystemAdmin


    Hi everyone,

    I need help in understanding how can I parse unordered text file using WTX. The text file is something like this

    ---START OF FILE----
    Account Number : XXXX
    Page 1
    something something
    <blank line>
    <blank line>
    ....<unknown number of lines with blanks or non-blanks>

    Date Particulars Amt
    12-Jan-2010 Transfer 12345.00
    12-Jan-2010 Transfer 12345.00
    12-Jan-2010 Transfer 12345.00
    .... <unknown number of records>

    Account Number : XXXX
    Page 2
    something something
    <blank spaces>
    <blank spaces>
    ....<unknown number of records>

    Date Particulars Amt
    12-Jan-2010 Transfer 12345.00
    12-Jan-2010 Transfer 12345.00
    12-Jan-2010 Transfer 12345.00
    .... <unknown number of records>
    ---END OF FILE----

    I can figure out the row column parsing since its fixed length. I am unable to ignore the unwatned lines dynamically in my type tree. I want to create a map which will ignore all other lines (Start of file till it reaches value "Date" in a repeating structure)till it reaches end of file .

    How can I parse this using WTX?
    Thanks all.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Parsing Unordered Text File

    Posted Wed October 27, 2010 09:48 AM

    Originally posted by: vijji_WTX


    Hi,

    Can u share sample input file. I am unable to get the structure you mentioned below.It helps to suggest right solution.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 3.  Re: Parsing Unordered Text File

    Posted Thu October 28, 2010 02:11 AM
      |   view attached

    Originally posted by: SystemAdmin


    Hi vijji,
    thx for your reply.
    pls find the sample file attached.
    From the file, I only need to map all the records under the Date, description, reference no.... fields. Hence i need to ignore all records above it.
    Note, Date, Desc appears multiple times in a file. the number of lines before it is not constant.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange

    Attachment(s)



  • 4.  Re: Parsing Unordered Text File

    Posted Thu October 28, 2010 04:56 AM

    Originally posted by: vijji_WTX


    Hi,

    I found below approach could be good one to handle this.
    TypeTree will consists of 3 groups.

    Address Group will read first first part of Address lines...and should start from Account Number initiator

    Account Number : 123456
    Page 3
    101-104 TULSIANI CHAMBERS
    FREE PRESS JOURNAL MARG
    MUMBAI
    400020

    FiledName Group will consists of BOLB type and read below line. Initiator would be Date for this and CRLF will be terminator

    DATE DESCRIPTION REFERENCE No VALUE DATE DEBITS CREDITS BALANCE

    Detail Group should ignore Account number initiator records and loop based on records.Here i could see Description comming in 2 lines. So we need 2 records in Details group , one as main record and second is secondary record.

    You can ignore Entire Address Group by using Filler.Not sure how to implement his for line by line records. Once you are able to read Detail record as per it's fixed length size.

    let me know in case you need any furthur info. It is bit complex input to handle and need some R&D. All the best!!
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender