113408
113408

Reputation: 3444

Parse data from non structured file

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 ?

Upvotes: 1

Views: 290

Answers (1)

rolfl
rolfl

Reputation: 17707

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?

Upvotes: 3

Related Questions