delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/09/23/17:19:19

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "osmium" <r124c4u2 AT mediaone DOT net>
Newsgroups: comp.lang.c,comp.os.msdos.djgpp,comp.lang.c++
References: <3C0BEC9D DOT 4D74A6CA AT surfeu DOT fi>
Subject: Re: String substitution to another
Date: Mon, 3 Dec 2001 08:45:37 -0800
Lines: 16
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Message-ID: <3c0b8e8f_2@goliath.newsgroups.com>
X-Authenticated-User: gamma
X-Comments: This message was posted through Newsfeeds.com
X-Comments2: IMPORTANT: Newsfeeds.com does not condone, nor support, spam or any illegal or copyrighted postings.
X-Comments3: IMPORTANT: Under NO circumstances will postings containing illegal or copyrighted material through this service be tolerated!!
X-Report: Please report illegal or inappropriate use to <abuse AT newsfeeds DOT com> You may also use our online abuse reporting from: http://www.newsfeeds.com/abuseform.htm
X-Abuse-Info: Please be sure to forward a copy of ALL headers, INCLUDING the body (DO NOT SEND ATTACHMENTS)
Organization: Newsfeeds.com http://www.newsfeeds.com 90,000+ UNCENSORED Newsgroups.
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Mr. Veli Suorsa writes:

> I need some advices.
> Please, show me, how I can read text file and substitute one string to
> another (e.g. 'christmas card' -> 'money') and save file again to same
> name.
>
> Here is an example C program to read text file lines, but what
> substitute commands should I add to it? Or are there ready functions in
> C++, too?

You will have to produce an intermediate file, call it 'temp'.  When temp is
complete, use remove() and rename() in <stdio.h> to produce the desired file
names.




-----=  Posted via Newsfeeds.Com, Uncensored Usenet News  =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
 Check out our new Unlimited Server. No Download or Time Limits!
-----==  Over 80,000 Newsgroups - 19 Different Servers!  ==-----

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019