Topic: change values in a text-file


Author: Francis Glassborow <francis@robinton.demon.co.uk>
Date: 2000/01/17
Raw View
In article <85vk3o$qh3$1@newsread.do2.de.uu.net>, Patrick
<p.pfleiderer@s-direktnet.de> writes
>I want to change some values at different positions in a normal text file.
>How can I realize this under C++?  I've got problems to set the pointer to a
>specific position. Is there a possibility to search for a special string in
>a textfile? Is it also possible to run a compiled program under MS-DOS?

Messing around with text files is a recipe for disaster.  If you open
and handle them entirely in binary mode you can probably manage, but
text mode has too many gotchas.

Why on earth should you not be able to run a compiled program under
MSDOS?


Francis Glassborow      Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA          +44(0)1865 246490
All opinions are mine and do not represent those of any organisation


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: "Patrick" <p.pfleiderer@s-direktnet.de>
Date: 2000/01/18
Raw View
Hi!

I want to change some values at different positions in a normal text file.
How can I realize this under C++?  I've got problems to set the pointer to a
specific position. Is there a possibility to search for a special string in
a textfile? Is it also possible to run a compiled program under MS-DOS?

Thanx 4 your help!

Patrick



======================================= MODERATOR'S COMMENT:
 As usual, please try to restrict replies to Standard C++.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]