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
Discussions
Discussions
Forums
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
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
тАО07-31-2006 12:34 AM
тАО07-31-2006 12:34 AM
---------------------
Hi,
Somehow I switch from Unix scripting to DOS batch command and need help here:
how to replace a word in a text file, such as "DEVPLOP" to "PRODUCTION", multiple times and save the file, either with original name or different name.
Unix script makes it simple, but DOS command seems to be remote to me.
Any help is appreciated!
Steven
Solved! Go to Solution.
- Tags:
- DOS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2006 12:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2006 12:49 AM
тАО07-31-2006 12:49 AM
Re: DOS help
- Tags:
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2006 12:55 AM
тАО07-31-2006 12:55 AM
Re: DOS help
If you are using a windows system for doing your DOS edit stuff, open the file in "notepad"
then you find under the edit menu, "replace" type in what you wanted to. Also note if you need to enable/disable the match case.
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2006 01:11 AM
тАО07-31-2006 01:11 AM
Re: DOS help
Any help is appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2006 01:45 AM
тАО07-31-2006 01:45 AM
Re: DOS help
1) Download sed for DOS:
http://www.student.northpark.edu/pemente/sed/ssed360s.zip
2) Extract sed-3.59.exe to a directory in %PATH%.
3) Rename sed-3.59.exe to sed.exe.
4) cd
5) sed 's/DEVELOP/PRODUCTION/g' < textfile > textfile.new
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2006 01:54 AM
тАО07-31-2006 01:54 AM
Re: DOS help
one workaround would be to send the text file to a unix machine, do the change and get it back.
of course, it will be easy if and only if it is a once off task.
hope this helps too!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2006 03:04 AM
тАО07-31-2006 03:04 AM
Re: DOS help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2006 06:56 AM
тАО07-31-2006 06:56 AM
Re: DOS help
I want to try Plan B. Do you have syntac handy so that I can jump right ahead?
Thanks,
Steven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2006 07:12 AM
тАО07-31-2006 07:12 AM
Re: DOS help
perl -i.save -p -e 's/DEVPLOP/PRODUCTION/g' file1 file2 ...
It will process each file listed and create a backup file1.save, file2.save, ... the modified files will be file1, file2, ...
If you don't want the backup files then omit the -i option.
- Tags:
- Perl