This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Search and Replace in a file
- From: "Tarun" <tarun at acmet dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Tue, 7 Nov 2006 12:44:01 +0530
- Subject: Search and Replace in a file
- Reply-to: <tarun at acmet dot com>
Hi all,
I am looking for a function that searches and replaces a string in a
normal text file. I managed to find functions for search and replace in
a string buffer but unable to do so for a file.
It would be something like:
SeachAndReplace(Filename, SearchString, ReplacementString)
I try to use a buffer to store the entire file contents I fear (and
encountered) stack overflow. Or if someone could help me find a
lightweight library for this :)
Thanks to all in advance
Tarun