locked
Flat file schema struggle RRS feed

  • Question

  • Hi, I'm struggling to create a FF schema for a particular file.
    The file is positional.

    It basically contains:
    one header line
    then multiple invoices

    For each invoice it contains:
    One invoice header
    One invoice posting line
    One additional info line
    Multiple transaction lines
    One tax posting line
    One tax control line

    All these invoice line types are of different lengths.

    The tax posting line is almost identical to the transaction lines (same characters at the beginning, but ultimately is of a different length).

    All lines within the file are terminated with a CR LF, apart form the last line of the file.

    Any help/advice is much appreciated.

    Thursday, November 27, 2014 12:28 PM

Answers

  • Hi Andrew,
    To start with, I just create flat-file schema for
    ·        One header line (element type  - Record)
    ·        Multiple invoices (repeating Record)..
    ·        Set rest of the lines as “Ignore”
    Then wizard will proceed to parse the Each-invoice (invoices in the repeating Record),
    ·        One invoice header (Record)
    ·        One invoice posting line (Record)
    ·        One additional info line(Record)
    ·        Multiple transaction lines (Repeating Record)
    ·        For rest of the transition line set the element type as “ignore”
    ·        One tax posting line(Record)
    ·        One tax control line(Record)
    Now wizard will proceed to parse, each transaction lines.
    Concentrate on parsing each Repeating Record at a time rather than worrying about the whole structure.

    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    • Proposed as answer by Vivin Muthu Tuesday, December 2, 2014 12:02 PM
    • Marked as answer by Angie Xu Thursday, December 4, 2014 1:30 AM
    Thursday, November 27, 2014 1:22 PM
  • Is there any exception you are getting .There are multiple articles over MSDN which shows how to separate Header with Body .

    You can follow below steps

    Step1) Open FlatFileSchema Wiz and define your name space and root. Choose the file that needs to be parsed.
    Step 2) Choose “By Delimiter Symbol” and click Next.
    Step 3) Instead of choosing a simple {CR}{LF} use the word that splits the Header and Body – In this case I used “START-OF-DAY{CR}{LF}”
    Step 4) On the next screen set the first element as “Header” and Element Type as FieldElement (Since we dont want to split the header).  On the second element though, choose the element type to be “Record” so we can split the data

    You can take reference from below articles

    Flat File Disassembly Using a Header

    Thanks

    Abhishek

    • Proposed as answer by Vivin Muthu Tuesday, December 2, 2014 12:02 PM
    • Marked as answer by Angie Xu Thursday, December 4, 2014 1:30 AM
    Thursday, November 27, 2014 2:27 PM

All replies

  • Can you provide us with a sample? Will be easier to help you...


    Glenn Colpaert - Microsoft Integration MVP - Blog : http://blog.codit.eu

    Thursday, November 27, 2014 1:12 PM
  • Hi Andrew,
    To start with, I just create flat-file schema for
    ·        One header line (element type  - Record)
    ·        Multiple invoices (repeating Record)..
    ·        Set rest of the lines as “Ignore”
    Then wizard will proceed to parse the Each-invoice (invoices in the repeating Record),
    ·        One invoice header (Record)
    ·        One invoice posting line (Record)
    ·        One additional info line(Record)
    ·        Multiple transaction lines (Repeating Record)
    ·        For rest of the transition line set the element type as “ignore”
    ·        One tax posting line(Record)
    ·        One tax control line(Record)
    Now wizard will proceed to parse, each transaction lines.
    Concentrate on parsing each Repeating Record at a time rather than worrying about the whole structure.

    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    • Proposed as answer by Vivin Muthu Tuesday, December 2, 2014 12:02 PM
    • Marked as answer by Angie Xu Thursday, December 4, 2014 1:30 AM
    Thursday, November 27, 2014 1:22 PM
  • Is there any exception you are getting .There are multiple articles over MSDN which shows how to separate Header with Body .

    You can follow below steps

    Step1) Open FlatFileSchema Wiz and define your name space and root. Choose the file that needs to be parsed.
    Step 2) Choose “By Delimiter Symbol” and click Next.
    Step 3) Instead of choosing a simple {CR}{LF} use the word that splits the Header and Body – In this case I used “START-OF-DAY{CR}{LF}”
    Step 4) On the next screen set the first element as “Header” and Element Type as FieldElement (Since we dont want to split the header).  On the second element though, choose the element type to be “Record” so we can split the data

    You can take reference from below articles

    Flat File Disassembly Using a Header

    Thanks

    Abhishek

    • Proposed as answer by Vivin Muthu Tuesday, December 2, 2014 12:02 PM
    • Marked as answer by Angie Xu Thursday, December 4, 2014 1:30 AM
    Thursday, November 27, 2014 2:27 PM
  • sample files are too big                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Thursday, November 27, 2014 4:08 PM
  • I have listed you the steps , If still you face any issue please let us know the error
    Friday, November 28, 2014 8:38 AM