array and reading from file
District 1 District 2 District 3 District 4
285 251 851 562 name1
521 423 874 547 name2
451 362 862 845 name3
411 562 846 245 name4
420 285 765 365 name5
this stuff reads from the file ,except districts names. I want to know how do I put these numbers(district1,2,3,4) columns into one numeric array number? for example I want to add all the numbers in district 1 and display total from that district. I also want to display total number out of all the districts. I want this to be an array.
Re: array and reading from file
Other than reading file line-by-line, splitting numbers into say some temp array and increment some variables you wouldn't have many other options... :ehh:
However, if you can substitute text file with database (perhaps MS Access) it could be as simple as executing very basic sql:
select sum(filed1) where field2 = 'District1'
Re: array and reading from file
there is no way to do that without rearranging the txt file to do that in VB 6.0? I guess I will have to make 4 different variables to get the total of each one.