Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to replace the exact word in vi editor??
suppose a file contains words like amaze,amazed,amazement in
some of the line.But i want to replace only 'amaze' with
delight but don't wanna replace amazed or amazement.
thanks

Answers were Sorted based on User's Feedback



How to replace the exact word in vi editor?? suppose a file contains words like amaze,amazed,amazem..

Answer / shilpi gupta

sed 's/\<amaze\>/delight/g' file_name

or

In Vi editor..you can use

:%s/\<amaze\>/delight/g

Is This Answer Correct ?    7 Yes 0 No

How to replace the exact word in vi editor?? suppose a file contains words like amaze,amazed,amazem..

Answer / chandra babu.p

s/string/string/g;
ex;

:s/unix/linux/g

Is This Answer Correct ?    5 Yes 2 No

How to replace the exact word in vi editor?? suppose a file contains words like amaze,amazed,amazem..

Answer / majeed

First open the file by using vi editor and then

use this :%s /amaze/delight/g

Is This Answer Correct ?    3 Yes 2 No

How to replace the exact word in vi editor?? suppose a file contains words like amaze,amazed,amazem..

Answer / supreet goswami

sed-i "s| amaze |delight|g" filename

Is This Answer Correct ?    0 Yes 0 No

How to replace the exact word in vi editor?? suppose a file contains words like amaze,amazed,amazem..

Answer / kranthi kumar

:1,$s/amaze$/amazing/g

this will be changed only amaze in totalvi editor....

Is This Answer Correct ?    2 Yes 3 No

How to replace the exact word in vi editor?? suppose a file contains words like amaze,amazed,amazem..

Answer / ahmed

sed 's/amaze/amazing/g' filename.txt

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Unix Commands Interview Questions

What is the comma to show the space allocation of files?

0 Answers  


Which command is used to kill the last background job?

0 Answers  


what are wild cards?

2 Answers  


What is the first character of the output in ls l command?

0 Answers  


Write a command that will allow a unix system to shut down in 15 minutes, after which it will perform a reboot.

0 Answers  


what are the different operating systems available?

3 Answers  


What does 'mkdir' command do in UNIX?

0 Answers   Syntel, Visa,


Which command can you use to find the currently running process in unix server?

0 Answers  


how to change a normal file into hidden file

3 Answers  


What is shrinking file system in AIX where it actually resides?

0 Answers  


use of ls command

9 Answers  


How do I use nslookup?

0 Answers  


Categories