i have a file called file1
cat file1 i am namish namish lives in India India and namish both are good.
I want to delete all the occurences of namish in one shot,if i do it with sed i guess all the lines will be deleted containing the pattern.Suggest me any idea without AWK.
Thanks Namish
sed 's/namish//g' file1
Thanks for the reply.
If i do not want the space at the place of the deleted pattern,what is suggested.
sed 's/ *namish *//g' file1
or
sed 's/^namish //g; s/ namish$//g; s/ namish / /g' file1
Thanks robotronic!
use vi editor and replace all occurances of namish with " "
and what if there are 1000 occurances of namish in it? Then in command mode:
:1,$s/namish//g