Hi..,
I want to replace one string to another string by using unix
1.by using vi editor
2.with out using vi editor
for ex:
I/p is like
---------------
sushma is reading books,sushma is watching movie,sushma is cooking....
o/p is:
---------
bargavi is reading books,bargavi is watching movie,bargavi is cooking.
i want
How to replace one string to another string by using unix
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 376
- Joined: Sat Jan 07, 2012 12:25 pm
- Location: Piscataway
1. Using vi editor
A. :s/search_string/replacement_string/g
2. Without using vi editor.
A. sed s/search_string/replacement_string/g <filename>
A. :s/search_string/replacement_string/g
2. Without using vi editor.
A. sed s/search_string/replacement_string/g <filename>
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn
Life is really simple, but we insist on making it complicated.
Data Integration Consultant at AWS
Connect With Me On LinkedIn
Life is really simple, but we insist on making it complicated.
-
- Premium Member
- Posts: 536
- Joined: Thu Oct 11, 2007 1:48 am
- Location: Bangalore
1. Using vi editor
2. Without using vi editor.
Code: Select all
s1,$/sushma/bargavi/g
Code: Select all
sed 's/sushma/bargavi/g' <Input file Name > Output file Name
Thanks
Prasoon
ETL Consultant
LinkedIn :- http://www.linkedin.com/profile/view?id ... ab_pro_top
Blog:- http://dsshar.blogspot.com/
Prasoon
ETL Consultant
LinkedIn :- http://www.linkedin.com/profile/view?id ... ab_pro_top
Blog:- http://dsshar.blogspot.com/