Hi, I am trying to write a somewhat basic program to read and write to a .cfg file(text file).

Inside the .cfg file are a bunch of lines like so:

servername Test
server_no 1
server_group 1

etc, etc.

The first word in the line being the name and second being the value. What I am wanting to do is to read/load all of these values into separate text boxes, be able to edit them, and then save/write them back to the file(append).

What I am needing assistance with is how to read the information and write the information since the name needs to stay the same, and I just need to edit the value.

Basically I would like it to search the document, find the name string, and load whatever the value is into the text box.

Any assistance would be appreciated. Thanks.

What could you do is use the standar "key=value" style in you configuration file.
Then you should be able to read the whole text, then split the keys & the values, by setting the seperator to be the '='. Then when you want to write back to the file, then you simply delete all the content from your file, and you write them back again, this time with the new values.

Hope i helped,
Alex :)