file concept - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

file concept

praveensurampraveensuram Posts: 1Member
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

Comments

  • IDKIDK Posts: 1,784Member
    : 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:
    [code]
    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
    [/code]

    'print' means to write to the outputfile.
Sign In or Register to comment.