Announcement Announcement Module
Collapse
No announcement yet.
Multi-line record Item Writer with variable line numbers per record Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multi-line record Item Writer with variable line numbers per record

    Hello All,

    I have the below requirement but am not able to decide on the approach to take:

    I need to write data to a fixed format out put file where each record spans over multiple lines as seen below:

    Code:
    000012099259999999000000000000000929110000000000000000000000001000
    000000000000000000000006050052570009700000050000990494920000111100
          ABCDE:WXYZ                                              0200
          descriptiongoesheredescriptiongoesheredescriptiongoesher0200
          descriptiongoesheredescriptiongoesheredescriptiongoesher0200
          descriptiongoesheredescriptiongoesheredescriptiongoesher0200
          descriptiongoesheredescriptiongoesheredescriptiongoesher0200
    000000000000000000000006050052730005700001100000090494920000221200
          ABCDE:WXYZ                                              0200
          descriptiongoesheredescriptiongoesheredescriptiongoesher0200
          descriptiongoesheredescriptiongoesheredescriptiongoesher0200
    000000000000000000000006050113110009700000000000000494920000311100
          ABCDE:WXYZ                                              0200
          descriptiongoesheredescriptiongoesheredescriptiongoesher0200
          descriptiongoesheredescriptiongoesheredescriptiongoesher0200
          descriptiongoesheredescriptiongoesheredescriptiongoesher0200
    000012099259999999000000000000000929110000000000000000000000001000
    The first and last line are header and footer respectively.
    First line of each record contains several details.
    2nd line have some other details with spaces.

    I have a long description field which I need to divide into 56 characters sections and append those with record's 3rd line onwards.

    So in some of the records, this may be just one line while in some it could be three lines as well.

    Can any one please help how to design my item writer.

    Thanks
    Nik
    Last edited by nikunj_c; Oct 20th, 2011, 09:29 AM. Reason: code block not proper

  • #2
    Check here for answer:

    Comment

    Working...
    X