Need Help with Getting Info from Text files

Hey, I've been searching around for a while, and haven't really found a good way to do this...

Program Information:
What I want to do in a nutshell is create a program in which the user can enter in the amount of gas they purchased, the miles before, miles after, and price per gallon. It would then calculate the miles driven, MPG, and all that other stuff (I know how to do this)
But I want it to keep a running tally. (so the user can use the program whenever they get gas, and find the total average for all entries) So I would write this info to a .txt file. (I know how to do this too..)

However there are a few problems...

The problems:
1. When the text file is opened, I need it to go to the next available line if it is going to write info. (so nothing is overwritten)
2. I need a way to locate where the total price, total MPG, etc. is located in the text document and then be able to use that data.

I would greatly appreciate any help with this issue, as I just got my license and would like to keep track of spending :)
Topic archived. No new replies allowed.