|
-
Apr 22nd, 2009, 06:59 AM
#1
Thread Starter
Lively Member
Question about reading a text file.
I have a text file with single line entries, running in the hundreds, if not thousands. And the text file gets continually populated. Basically its a baseball score list with each players latest stats coming in the last line of the file. The format for the file is as follows.
Name, At bats, hits, singles, doubles, triples, homeruns, avg
BEN, 110, 34, 24, 9, 1, 6, 3.09
ART, 109, 24, 19, 2, 0, 3, 2.20
BEN, 111, 34, 24, 9, 1, 6, 3.09
MIKE, 100, 30, 27, 3, 0, 4, 3.00
What I want to do is extract the last value for each name only. I mean, if I want Ben's stats, I just want the latest entry in the file, since thats the most recent. How can i go about doing that? I have fidgeted around with code a lot, but got nowhere.
Basically I need a way to read the file from the bottom up, searching for the first record for each name, since that will be the latest entry for that name.
Any ideas, or pointers?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|