Given the contents of a.txt...
You should get some patterns there.
If the example you've given is like the quote below,
|
Quote:
|
S.No Description Qty. Units Rate (Rs.) Value(Rs.)
1 Aviation_Lamp 1 Nos 3700 3,700
2 Lighting_Arrester 1 Nos 1600 1,600
3 Aviataion_Lamp_Cable 31 Rmt 270 8,370
|
You can use Scanner class for this.
|
Code:
|
while(scannerObject.hasNext()){
s.no = scannerObject.next();
description = scannerObject.next();
qty = scannerObject.next();
unit = scannerObject.next();
rate = scannerObject.next();
value = scannerObject.next();
print those values....
} |
Try to have some experiments from it....
(Printing on console may be a good tests)
After that, read the Formatter class....
You can format it like the format you've post...
|
Code:
|
Formatter.format("%s\n", String); |
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully