- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- VI string manipulation
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
01-17-2002 08:19 AM
01-17-2002 08:19 AM
solution. We like some information re: the
ability on how to take a name in a flat file and using string maipulation change that name to another, for example...
for every occurrance of BOB found change it to FRANK. We like this to be a script that can be
launched via Crontab.
-barry donovan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 08:21 AM
01-17-2002 08:21 AM
Re: VI string manipulation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 08:22 AM
01-17-2002 08:22 AM
Re: VI string manipulation
You need to use the sed command to it;
eg. if you have a file called tt.txt then;
cat tt.txt | sed 's/BOB/FRED/g' >
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 08:24 AM
01-17-2002 08:24 AM
Re: VI string manipulation
sed -e "s/BOB/FRANK/g" file > outfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 08:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 08:26 AM
01-17-2002 08:26 AM
Re: VI string manipulation
sed 's/BOB/FRANK/g' filename > filename2
If you want to create a lot of changes the create a sed script file called sedfile
s/BOB/FRANK/g
S/CRAIG/JOE/g
then call it from the command line
sed -f sedfile filename > filename2
GL,
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 08:29 AM
01-17-2002 08:29 AM
Re: VI string manipulation
:%s/BOB/Frank/g
Make sure you have escaped command mode before entering this.
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 08:58 AM
01-17-2002 08:58 AM
Re: VI string manipulation
awk '{gsub(/BOB/, FRANK, $0);print}' filename > filename.new