The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 04-20-2008
grotesque grotesque is offline
Registered User
 

Join Date: Jan 2008
Posts: 6
Replacing line with a new file in a file

Hi,

I have a txt file which contains:

Apple is red.
Orange is orange.
Banana is yellow.
Strawberry is red.

-eof-


How do I go about replacing "Banana is yellow" with "Cherry is red"? I tried to use seekp to get the position of Banana and replace that line but unable to.

Please advise. Thanks.
Reply With Quote
Forum Sponsor