HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Find and replace the word
Operating System - OpenVMS
1829494
Members
1467
Online
109991
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
06-23-2007 05:11 PM
06-23-2007 05:11 PM
Find and replace the word
I have to write a script to find different word in a file and replace all the words into a sequential array.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2007 09:33 PM
06-23-2007 09:33 PM
Re: Find and replace the word
Hi amit27k
welcome to the ITRC Forum.
Could you supply some more information. Maybe you could post a part of your file and explain what you want to exchange.
regards
Geni
welcome to the ITRC Forum.
Could you supply some more information. Maybe you could post a part of your file and explain what you want to exchange.
regards
Geni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2007 03:27 AM
06-24-2007 03:27 AM
Re: Find and replace the word
Hello amit,
Welcome to the OpenVMS ITRC Forum.
>> I have to write a script to find different word in a file and replace all the words into a sequential array.
Please explain to us WHY you have to do this and perhpas WHICH TOOLS are at your disposal.
What is a 'word' in you world? (any combination of characters outside whitespace?)
What is a sequential array in your world?
(In my world an array is a memory structure, for you perhaps just an other flat file ?)
'Replace' in my world means to put something in the place of something else. So when we find a word, what will be replaced?
What problem are you trying to solve?
- world hunger?
- a homework question?
- a serious business problem?
perl -ne "chomp; $w{$_}++ foreach split /\W+/} {print qq($w{$_}:$_\n) foreach (sort keys %w)" login.com
Regards,
Hein.
Welcome to the OpenVMS ITRC Forum.
>> I have to write a script to find different word in a file and replace all the words into a sequential array.
Please explain to us WHY you have to do this and perhpas WHICH TOOLS are at your disposal.
What is a 'word' in you world? (any combination of characters outside whitespace?)
What is a sequential array in your world?
(In my world an array is a memory structure, for you perhaps just an other flat file ?)
'Replace' in my world means to put something in the place of something else. So when we find a word, what will be replaced?
What problem are you trying to solve?
- world hunger?
- a homework question?
- a serious business problem?
perl -ne "chomp; $w{$_}++ foreach split /\W+/} {print qq($w{$_}:$_\n) foreach (sort keys %w)" login.com
Regards,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2007 12:03 PM
06-24-2007 12:03 PM
Re: Find and replace the word
Is this a global substitute? Here's a DCL solution using TPU
$ IF p1.EQS."" THEN INQUIRE p1 "Word to be replaced"
$ IF p2.EQS."" THEN INQUIRE p2 "Word to replace it with"
$ IF p3.EQS."" THEN INQUIRE p3 "File to replace it in"
$ ws="WRITE SYS$OUTPUT"
$ PIPE ws "EVE_GLOBAL_REPLACE(""''p1'"", ""''p2'"");" | -
EDITX/TPU/NODISPLAY/COMMAND=SYS$PIPE: 'p3'
$ EXIT
$ IF p1.EQS."" THEN INQUIRE p1 "Word to be replaced"
$ IF p2.EQS."" THEN INQUIRE p2 "Word to replace it with"
$ IF p3.EQS."" THEN INQUIRE p3 "File to replace it in"
$ ws="WRITE SYS$OUTPUT"
$ PIPE ws "EVE_GLOBAL_REPLACE(""''p1'"", ""''p2'"");" | -
EDITX/TPU/NODISPLAY/COMMAND=SYS$PIPE: 'p3'
$ EXIT
A crucible of informative mistakes
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP