C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28629
Number of posts: 94611

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
file concept Posted by praveensuram on 12 May 2006 at 3:06 AM
how to replace a word in a given file with another word ?
that file may contain a single sentence or a passage. while replaceing the word the spaces left have to be deleted if the given word is smmaler than tha actual word in the passage and if the given word is bogger than the actual word exrta space have to be created at he actual word so that the given word may fit at hat place


i have used files and file reading concepts and some funtions in strings

can anyone send me the required solution i am very much in need of that

Report
Re: file concept Posted by IDK on 12 May 2006 at 4:05 AM
: how to replace a word in a given file with another word ?
: that file may contain a single sentence or a passage. while replaceing the word the spaces left have to be deleted if the given word is smmaler than tha actual word in the passage and if the given word is bogger than the actual word exrta space have to be created at he actual word so that the given word may fit at hat place
:
:
: i have used files and file reading concepts and some funtions in strings
:
: can anyone send me the required solution i am very much in need of that
:
:
this is the psuedo algo:
while file1 got input
  read one char from file1 to a
  if a = first char of search string
    read the rest bytes and compare,
    if equall then print out search string
    if not then print out the rest bytes previusly read
  else
    print a


'print' means to write to the outputfile.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.