-4

i will write an EFT system with java. I will read information from a file and file's content has a standard. For example;

# Number of banks

2

# BankID, InitialCashReserve

1  0
2  100

# EFTID, Amount, FromBankID, ToBankID

1  40  1  2
2  10  2  1
3  20  2  1
4  30  2  1
5  40  2  1
6  50  2  1
7  60  1  2

Is there an easy way to read these or do I have to read line by line and check.

xxlali
  • 996
  • 2
  • 15
  • 43

1 Answers1

0

You'll have to read it line by line.

If I were you, I'd load the entire contents of the file into some sort of object structure before using the data, that way you won't have to be going back and forth through the file stream during the operation of your program.

If there's a library for your file type, that library will pretty much do those 2 steps for you anyway.

  • I know there is no library for my file type just I wondered is there any way to do that easily. Thanks for the advice. – xxlali May 13 '13 at 18:26