Overwriting to a Text File

I have the following in a text file (for example):

15600 TEXT...200.0 TEXT...

where "..." is either whitespace of text and "15600" is a line number. Now say I want to go into this text file, find line marked "15600" and replace the "200.0" with "0.000" so that nothing moves (as if the numbers were in a fixed column on the right edge). I don't want to have to read and write the entire line, just overwrite the 200.0. Is there a way to do this? Someone in a previous post I made said something about counting out to the 2 then writing, but I'm not sure how to do that, or exactly the best method for finding 15600 (I can parse a file and find line that contains 15600, but the entire line will be stored as a string, so how do I go and edit that string to replace just the 200.0?).

Thanks in advance!
Last edited on
The string class has a replace function: http://www.cplusplus.com/reference/string/string/.
I figured that out while I was waiting. Thanks for your help, though.
Topic archived. No new replies allowed.