Hi,

I am trying to create a simple program thats reads banking information from a text file. The text file is layout out line by line. I know that there is definitley 14 lines for each customer but the amount of accounts the customer has is dependant on the 14th line of customer information, and then the amount of transactions a customer has is dependent on the 7th line (or 21st line in the text file) of accounts.

Attached is the text file and another text file explaining how its layed out.

I have been able to read upto the number of accounts a customer has but after this for example a customer could have 2 accounts with 4 transactions each or 1 account with 1 transaction.

What i would like to know is how i would read this information into the program. Would it be just one large arraylist or will i need 3 separate arraylists for Customer, accounts and transactions so i can edit and delete records.

Attachments
1458879524
Mr
Patrick
J
McCabe
19/12/1968
243a
Beacon Park Road
Mannadon
Plymouth
Devon
PL237JP
icyfish9
1
56-85-87
4.14578E+11
ours + kids!!!
01/03/2008
1523.25
500
10
02/02/2010
D/D
Freshling Nursery
650
2173.25
02/02/2010
C/R
Child benefit
-20
2153.25
05/02/2010
OTR
Vets4Pets - insurance service
-44.55
2108.7
08/02/2010
D/D
Diet Coke shippers - trade only
-800
1308.7
12/02/2010
S/O
Lecky Recky Suppliers
-145
1163.7
17/02/2010
D/D
South Waste Water
-75
1088.7
22/02/2010
D/D
What a GAS supplier
-88.56
1000.14
02/03/2010
ATM
Morriston Swansea
-120
880.14
02/03/2010
BAC
UNiversity of Plymouth
4542.36
5422.5
02/03/2010
S/O
PCC - Council Tax
-95.67
5326.83
1425478594
Mrs
Gemma
K
Reynolds
02/12/1987
27
Flat Road
Mannamead
Plymouth
Devon
PL87TS
muppetsman1a
2
54-25-36
12455871265
jennies uni account !!!
02/12/1999
-25.36
1000
8
02/02/2010
D/D
Freshling Nursery
-650
-675.36
02/02/2010
C/R
Child benefit
20
-655.36
05/02/2010
OTR
Vets4Pets - insurance service
-44.55
-699.91
08/02/2010
D/D
Diet Coke shippers - trade only
-800
-1499.91
12/02/2010
S/O
Lecky Recky Suppliers
-145
-1644.91
17/02/2010
D/D
South Waste Water
-75
-1719.91
22/02/2010
D/D
What a GAS supplier
-88.56
-1808.47
02/03/2010
ATM
Morriston Swansea
-120
-1928.47
58-69-71
12455871265
jennies uni account !!!
02/12/1999
-25.36
1000
2
02/02/2010
D/D
Freshling Nursery
-650
-675.36
02/02/2010
C/R
Child benefit
20
-655.36
" 	Customer ID number --- this is the first customer 1

" 	Customer title

" 	Customer first name

" 	Customer initials  //not required - defaults to null

" 	Customer surname

" 	Customer date of birth

" 	Customer house name or number

" 	Customer street name

" 	Customer address area  //not required - defaults to null

" 	Customer city or town name

" 	Customer county

" 	Customer postcode

" 	Customer password *minimum size is 8 characters in length

" 	The number of accounts belonging to this customer ---  equals 2 in this example



	o	Account sort code --- this is the first account of customer 1

	o	Account Number

	o	Account Nick Name //not required   defaults to null

	o	Date the account was created

	o	Current account balance

	o	Account  overdraft limit

	o	Number of transactions available for this account---  equals 2 in this example 



			Transaction Date --- this is the first transaction of account 1

			Transaction Type

			Transaction Description

			Transaction Amount

			Transaction Balance after transaction has been applied to account



			Transaction Date --- this is the second transaction of account 1

			Transaction Type

			Transaction Description

			Transaction Amount

			Transaction Balance after transaction has been applied to account



	o	Account sort code --- this is the second account of customer 1

	o	Account Number

	o	Account Nick Name //not required   defaults to null

	o	Date the account was created

	o	Current account balance

	o	Account  overdraft limit

	o	Number of transactions available for this account---  equals 2 in this example

 

			Transaction Date --- this is the first transaction of account 2

			Transaction Type

			Transaction Description

			Transaction Amount

			Transaction Balance after transaction has been applied to account



			Transaction Date --- this is the second transaction of account 2

			Transaction Type

			Transaction Description

			Transaction Amount

			Transaction Balance after transaction has been applied to account





" 	Customer ID number --- this is the second customer 

" 	Customer title

" 	Customer first name

" 	Customer initials  //not required - defaults to null

" 	Customer surname

" 	...

" 	...

" 	...

I would create a Customer, Account and a Transaction class.
A Customer class would have a List<Account> and an Account class would have a List<Transaction>

Thanks for the reply.

At the moment i have got this (attached is the program and the text file) which reads in the first customer details. I am having a bit of trouble reading in the account details. How would i read from the 15th line in the text file as that is where the first account starts.

Attachments
1458879524
Mr
Patrick
J
McCabe
19/12/1968
243a
Beacon Park Road
Mannadon
Plymouth
Devon
PL237JP
icyfish9
1
56-85-87
4.14578E+11
ours + kids!!!
01/03/2008
1523.25
500
10
02/02/2010
D/D
Freshling Nursery
650
2173.25
02/02/2010
C/R
Child benefit
-20
2153.25
05/02/2010
OTR
Vets4Pets - insurance service
-44.55
2108.7
08/02/2010
D/D
Diet Coke shippers - trade only
-800
1308.7
12/02/2010
S/O
Lecky Recky Suppliers
-145
1163.7
17/02/2010
D/D
South Waste Water
-75
1088.7
22/02/2010
D/D
What a GAS supplier
-88.56
1000.14
02/03/2010
ATM
Morriston Swansea
-120
880.14
02/03/2010
BAC
UNiversity of Plymouth
4542.36
5422.5
02/03/2010
S/O
PCC - Council Tax
-95.67
5326.83
1425478594
Mrs
Gemma
K
Reynolds
02/12/1987
27
Flat Road
Mannamead
Plymouth
Devon
PL87TS
muppetsman1a
2
54-25-36
12455871265
jennies uni account !!!
02/12/1999
-25.36
1000
8
02/02/2010
D/D
Freshling Nursery
-650
-675.36
02/02/2010
C/R
Child benefit
20
-655.36
05/02/2010
OTR
Vets4Pets - insurance service
-44.55
-699.91
08/02/2010
D/D
Diet Coke shippers - trade only
-800
-1499.91
12/02/2010
S/O
Lecky Recky Suppliers
-145
-1644.91
17/02/2010
D/D
South Waste Water
-75
-1719.91
22/02/2010
D/D
What a GAS supplier
-88.56
-1808.47
02/03/2010
ATM
Morriston Swansea
-120
-1928.47
58-69-71
12455871265
jennies uni account !!!
02/12/1999
-25.36
1000
2
02/02/2010
D/D
Freshling Nursery
-650
-675.36
02/02/2010
C/R
Child benefit
20
-655.36
This article has been dead for over six months. Start a new discussion instead.