- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how replace replace a particular string repeated f...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 08:22 PM
08-09-2005 08:22 PM
i have a file which contains a word "value" for repeated no. of times and i want to replace that word to "rate" how do i do.
replacing mainually is not that much possible.
Help me please
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 08:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 08:31 PM
08-09-2005 08:31 PM
Re: how replace replace a particular string repeated for many times
# vi file
the do the command
:%s/value/rate/g
this will do ur work.
Regards,
Syam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 08:44 PM
08-09-2005 08:44 PM
Re: how replace replace a particular string repeated for many times
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 08:46 PM
08-09-2005 08:46 PM
Re: how replace replace a particular string repeated for many times
you could also try
vi
:%s/
That's it
Franky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 08:48 PM
08-09-2005 08:48 PM
Re: how replace replace a particular string repeated for many times
:%s/value/rate/gi
g - globally changes it
i - user input to do if yes no if no
Using perl,
perl -pi -e 's/value/rate/g'
Using sed,
sed -e 's/value/rate/g'
mv newfilename filename
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 09:02 PM
08-09-2005 09:02 PM
Re: how replace replace a particular string repeated for many times
for i in `ls
do
perl -pi -e 's/
done
HTH
Franky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 09:13 PM
08-09-2005 09:13 PM
Re: how replace replace a particular string repeated for many times
for i in `ls
do
sed -e 's/
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 09:23 PM
08-09-2005 09:23 PM
Re: how replace replace a particular string repeated for many times
2. More important. Nobody protected the "value" against being part of another word, like "valued" or "invalueable" (give or take the typoes). The pattern to be replaced, if needed to be recognized as a word, needs to be anchored!
# perl -pi -e's/\bvalue\b/rate/g' file1 file2 file3 ...
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 09:24 PM
08-09-2005 09:24 PM
Re: how replace replace a particular string repeated for many times
perl -pi -e 's/value/rate/g'
Multiple files in multiple directory then,
find /
You can change * in change depends upon file pattern like *.log
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 09:39 PM
08-09-2005 09:39 PM
Re: how replace replace a particular string repeated for many times
# find
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2005 06:13 PM
08-10-2005 06:13 PM
Re: how replace replace a particular string repeated for many times
# for i in $(ls
> cat - <
> wq
> EOF
> done
regards!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2005 09:23 PM
08-10-2005 09:23 PM
Re: how replace replace a particular string repeated for many times
Thanks for all your valuble responce.
thank you.