Announcement Announcement Module
No announcement yet.
FixedLengthTokenizer with variable ranges/columns Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • FixedLengthTokenizer with variable ranges/columns

    Our legacy flat feed files have fixed length fields in each line. However the first two characters in the line identify which type of record it is. Based on the first two characters the ranges/columns would need to change.

    For e.g. a sample feed can look like this

    IA021 4430XAB3LN0005132079A0001318858C028670H0005132079A0001318858C028670H001{00{00
    BA041 4430XAB3LN00{000149120I146046E00
    TA031 4430XAB3LN00{0{00{00
    YL051 4430XAB3LN01276124{01275062H01275062H02148888H{10525
    The only way i could think of solving this is to have a delegating AbstractLineTokenizer that would hold references to multiple pre-configured FixedLengthTokenizer objects and then delegate call to appropriate tokenizer based on the first two identifying codes.

    Is there a better way for this?

    Thanks !

  • #2
    There's actually a sample job that shows how this can be implemented using the PrefixMatchingCompositeLineTokenizer, it's in both the 'multilineJob' and 'multilineOrderJob'