1

Hi i would like to know how i can parse data from a non structured file. the data is like in a table but there is juste spaces. Here is an example :

DEST    ULD    ULD      XXX     NEXT    NEXT    XXX   XXX
        XXX/   XXX      TYPE/   XXX     XXX     PCS   WGT
        BULK   NBR      SUBTYPE NBR     DEST

XXX     BULK            BF                        0         
XXX     BULK            BB                       39         
XXX     BULK            BB                        1         
XXX     BULK            BF                        0         
XXX     BULK            BB                        0 

I can't use delimiter as useDelimiter("\\s{2,9"); because the spaces changes between column...

Any idea ?

113408
  • 3,364
  • 6
  • 27
  • 54

1 Answers1

3

What you have is called fixed-length format. In some ways it is easier. What's the best way of parsing a fixed-width formatted file in Java?

Community
  • 1
  • 1
rolfl
  • 17,539
  • 7
  • 42
  • 76