Topic
  • 2 replies
  • Latest Post - ‏2019-05-02T11:28:33Z by Santanu
Santanu
Santanu
36 Posts

Pinned topic Flat File Mapping

‏2019-04-22T14:57:05Z |

Hi,

I have below input file

Header|04222019|abcd||101

5th field (101) has new line character at the end.

Identifier "Header" may or may not come in the input data.

so It can come as below 

04222019|abcd||101

We need to make a generic type tree to read both the above data with identifier and without identifier.

I have made 1st field as identifier "Header" (component rule) with range as 0:1.

Group properties as implict delimited with "|" location as postfix but its giving error at last field.

I have tried with location as infix and prefix as well but its giving error.

Looking forward for any suggestion

Thanks

Santanu

 

 

  • PaulBrett
    PaulBrett
    326 Posts
    ACCEPTED ANSWER

    Re: Flat File Mapping

    ‏2019-04-28T16:37:28Z  

    You'll need a component rule to ensure that the Header is recognised.  Perhaps you need a simple choice group, that will check for the 4 field style first, then default to 5 field style if 4 is a bust).

    If field 1 ('04222019' in the row type that will have 4 fields) is always going to be a number, then perhaps this would do:

    TONUMBER($)>0

    ...then have a second row type, which would then have 5 fields.

    Thank you.

    Paul

    Follow me on Twitter

  • PaulBrett
    PaulBrett
    326 Posts

    Re: Flat File Mapping

    ‏2019-04-28T16:37:28Z  

    You'll need a component rule to ensure that the Header is recognised.  Perhaps you need a simple choice group, that will check for the 4 field style first, then default to 5 field style if 4 is a bust).

    If field 1 ('04222019' in the row type that will have 4 fields) is always going to be a number, then perhaps this would do:

    TONUMBER($)>0

    ...then have a second row type, which would then have 5 fields.

    Thank you.

    Paul

    Follow me on Twitter

  • Santanu
    Santanu
    36 Posts

    Re: Flat File Mapping

    ‏2019-05-02T11:28:33Z  
    • PaulBrett
    • ‏2019-04-28T16:37:28Z

    You'll need a component rule to ensure that the Header is recognised.  Perhaps you need a simple choice group, that will check for the 4 field style first, then default to 5 field style if 4 is a bust).

    If field 1 ('04222019' in the row type that will have 4 fields) is always going to be a number, then perhaps this would do:

    TONUMBER($)>0

    ...then have a second row type, which would then have 5 fields.

    Thank you.

    Paul

    Follow me on Twitter

    Thanks Paul for your time and help.

     

    Thanks

    Santanu