0

0000321C#Miss Foo

23234HSBCA#123433-000HSBCAUS

00234HSBCB#222343-130HSBCCADCE

0000322C#Mr Bar

The given file is fixed width and the record containing A#,B# and C# maps to different models. (A#,B#andC# being the record indicators)

I did found a library (univocity-parser) where we can do something like this but the limitation is that the record indicator but be at the start of the line.

Please suggest.

1 Answers1

0

That's a pretty unusual requirement and frankly it's poor use of the fixed-width format as it requires the parser to read back and forth on each line, in the attempt to identify whether #C is at position 8, B# at 12 or #C at position 7, and only then consume the record using the appropriate format associated with the identifier.

If this is a real requirement for an application that is providing input like that to you, the only suggestion I can give is: implement this yourself with the help of this library or pay someone to do it for you if performance is a concern.

Jeronimo Backes
  • 6,141
  • 2
  • 25
  • 29