Archived

This topic is now archived and is closed to further replies.

move to certain point in file and replace line?

This topic is 5596 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have been trying to figure out all month how th do this, i want to move in an INI file and change a line from example; "user=12345" to maybe "user=32552". Thanks. BTW. (C++ code.) NULL [edited by - PSO_boy on August 17, 2002 4:52:40 AM]

Share this post


Link to post
Share on other sites
1) read the file in
2) parse file with e g scanf()
3) make the adjustments
4) dump the file

I''d say messing around with selective changes is far greater a hassle than taking on the entire INI file at a time, especially considering you have such a beautiful file layout (easy to scan). Another way would be counting bytes and such - you could write your own class for it or something, but I''ve heard of INI management utilities/libs out there so you might want to have a look in that as well.

Hope this helps,
Crispy

Share this post


Link to post
Share on other sites