Hi Mike,
I'd recommend you read the data not into an array, but rather into a
permanent table, either in Access or MS SQL (or any other sql database). If
you do this, you can develop indices, etc so that data is more manageable
and far more easy to access continuously. By reading it into an array, you
have to read everything every time you want to do anything. If I wants
Willie Mays only, it would be far easier to open a table where lname =
"Mays" and fname = "Willie".
Now to the real problem - if you want to use a streamreader to read the
file, that's fine - what you have to do is know the delimiters and/or column
(field) sizes; then read only the first column's data, append a row in the
new table and assign the value of that column - say, 1996 hits - to the new
table's 'hits' column. You have to do this for all columns - at bats, bases
on balls, errors, year, team with, etc - until you reach a chr(13) and
chr(10) - end of line. Then you add that row and open a new empty - and
continue until the job is done. For this you won't want to use readline, as
it will read the full line - all columns - to the end of a row. Instead,
use the read method, which will allow you to read character by character.
HTH,
Bernie Yaeger
"Mike Joseph" <l3********@yahoo.com> wrote in message
news:58****************************@phx.gbl...
I have a data file that was produced in MicroSoft Access.
It's a table that was exported as a fixed format,
sequential access ASCII file. It contains over 80,000
records. Basically, all the stats for every player in
Major League Baseball history in alphabetical order and
then by each year they played. I want to take this data
and display to the user the career totals for each player.
I don't seem to understand how to use StreamReader and the
Readling method. When I write out what I want to do with
the program either thru flowchart or just logical doodles
on some paper it seems pretty easy. I just can't get seem
to get it started by reading the file.
My idea was to read the data into an array. Each player
would occupy a row of the array and every time i read in a
new record for that player it would just add the new
yearly stats to the previous total to get the overall
total. So the finished array would have 15,000 or so rows
( one for each player ) and about 15 or so collums with
their career stats. Then it would be easy to display them
when the user selects a player. I just can;t figure out
how to get the data into an array in the order I'd want it
to be in :/
-Mike