• Post Reply Bookmark Topic Watch Topic
  • New Topic

Replace a String from a file  RSS feed

 
Kathiresan Chinnasamy
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

My problem is:

How to replace a particular line(it may be middle) from a file without writing tmp file?

For Example :

Sample.txt contains
one
tow
three

Here i want to insert two instead of tow....

Note:
Delete and rename options are restricted for this file
 
Joe Ess
Bartender
Posts: 9441
12
Linux Mac OS X Windows
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!