<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DOS help in Operating System - Microsoft</title>
    <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833847#M11149</link>
    <description>Hi Steven:&lt;BR /&gt;&lt;BR /&gt;Consider a file with these lines:&lt;BR /&gt;&lt;BR /&gt;this is DEVELOPMENT DEVELOP&lt;BR /&gt;DEVELOP&lt;BR /&gt;DEVELOPMENT&lt;BR /&gt;&lt;BR /&gt;# perl -ple 's/\bDEVELOP\b/PRODUCTION/gi' file&lt;BR /&gt;&lt;BR /&gt;...produces:&lt;BR /&gt;&lt;BR /&gt;this is DEVELOPMENT PRODUCTION&lt;BR /&gt;PRODUCTION&lt;BR /&gt;DEVELOPMENT&lt;BR /&gt;&lt;BR /&gt;...That is, "words" matching DEVELOP are replaced, not any string containing this sequence.  You were not very clear defining your requiremnents.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 01 Aug 2006 11:13:58 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2006-08-01T11:13:58Z</dc:date>
    <item>
      <title>DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833829#M11131</link>
      <description>This is a repost hoping to get some quick soul helps:&lt;BR /&gt;&lt;BR /&gt;---------------------&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Somehow I switch from Unix scripting to DOS batch command and need help here:&lt;BR /&gt;&lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;Unix script makes it simple, but DOS command seems to be remote to me.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any help is appreciated!&lt;BR /&gt;&lt;BR /&gt;Steven</description>
      <pubDate>Mon, 31 Jul 2006 07:34:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833829#M11131</guid>
      <dc:creator>Steven Chen_1</dc:creator>
      <dc:date>2006-07-31T07:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833830#M11132</link>
      <description>Hi Steven,&lt;BR /&gt;&lt;BR /&gt;cmd edit "open file" / "search and replace"&lt;BR /&gt;&lt;BR /&gt;Robert-Jan</description>
      <pubDate>Mon, 31 Jul 2006 07:43:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833830#M11132</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2006-07-31T07:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833831#M11133</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;sed for DOS is available here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.student.northpark.edu/pemente/sed/" target="_blank"&gt;http://www.student.northpark.edu/pemente/sed/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Mon, 31 Jul 2006 07:49:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833831#M11133</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-07-31T07:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833832#M11134</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If you are using a windows system for doing your DOS edit stuff, open the file in "notepad"&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Chan</description>
      <pubDate>Mon, 31 Jul 2006 07:55:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833832#M11134</guid>
      <dc:creator>Chan 007</dc:creator>
      <dc:date>2006-07-31T07:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833833#M11135</link>
      <description>I want a batch command, not doing it manually using notepad or ed utility, such as sed or awk doing text edition in an easy way.&lt;BR /&gt;&lt;BR /&gt;Any help is appreciated!</description>
      <pubDate>Mon, 31 Jul 2006 08:11:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833833#M11135</guid>
      <dc:creator>Steven Chen_1</dc:creator>
      <dc:date>2006-07-31T08:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833834#M11136</link>
      <description>Steven,&lt;BR /&gt;&lt;BR /&gt;1) Download sed for DOS:&lt;BR /&gt;&lt;A href="http://www.student.northpark.edu/pemente/sed/ssed360s.zip" target="_blank"&gt;http://www.student.northpark.edu/pemente/sed/ssed360s.zip&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;2) Extract sed-3.59.exe to a directory in %PATH%.&lt;BR /&gt;&lt;BR /&gt;3) Rename sed-3.59.exe to sed.exe.&lt;BR /&gt;&lt;BR /&gt;4) cd &lt;DIR_CONTAINING_TEXTFILE&gt;&lt;BR /&gt;&lt;BR /&gt;5) sed 's/DEVELOP/PRODUCTION/g' &amp;lt; textfile &amp;gt; textfile.new&lt;BR /&gt;&lt;BR /&gt;PCS&lt;BR /&gt;&lt;/DIR_CONTAINING_TEXTFILE&gt;</description>
      <pubDate>Mon, 31 Jul 2006 08:45:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833834#M11136</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-07-31T08:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833835#M11137</link>
      <description>hi steven,&lt;BR /&gt;&lt;BR /&gt;one workaround would be to send the text file to a unix machine, do the change and get it back.&lt;BR /&gt;&lt;BR /&gt;of course, it will be easy if and only if it is a once off task.&lt;BR /&gt;&lt;BR /&gt;hope this helps too!&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Mon, 31 Jul 2006 08:54:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833835#M11137</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-07-31T08:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833836#M11138</link>
      <description>Let me suggest a Plan B that will work in either a UNIX or a Windows environment -- Perl. You can install one of the free Perl's for Windows (e.g. &lt;A href="http://www.activestate.com)" target="_blank"&gt;www.activestate.com)&lt;/A&gt; and then your scripts (if well written) will work in both worlds without changes.</description>
      <pubDate>Mon, 31 Jul 2006 10:04:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833836#M11138</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-07-31T10:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833837#M11139</link>
      <description>A. Clay,&lt;BR /&gt;&lt;BR /&gt;I want to try Plan B.   Do you have syntac handy so that I can jump right ahead?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Steven</description>
      <pubDate>Mon, 31 Jul 2006 13:56:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833837#M11139</guid>
      <dc:creator>Steven Chen_1</dc:creator>
      <dc:date>2006-07-31T13:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833838#M11140</link>
      <description>Sure, and this will make an automatic backup file for you named filename.save where filename is the original source file.&lt;BR /&gt;&lt;BR /&gt;perl -i.save -p -e 's/DEVPLOP/PRODUCTION/g' file1 file2 ...&lt;BR /&gt;&lt;BR /&gt;It will process each file listed and create a backup file1.save, file2.save, ... the modified files will be file1, file2, ...&lt;BR /&gt;&lt;BR /&gt;If you don't want the backup files then omit the -i option.&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Jul 2006 14:12:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833838#M11140</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-07-31T14:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833839#M11141</link>
      <description>Hi Steven:&lt;BR /&gt;&lt;BR /&gt;In Perl, you could substitute the string PRODUCTION for that of DEVELOP in your file "inplace" like this:&lt;BR /&gt;&lt;BR /&gt;# perl -pi.old -e 's/\bDEVELOP\b/PRODUCTION/gi' file&lt;BR /&gt;&lt;BR /&gt;This substitution would occur case-insensitvely.  That is, the "i" following the string PRODUCTION means to match the string DEVELOP case-insensitively, and replace every occurance ((g)lobally) with "PRODUCTION".&lt;BR /&gt;&lt;BR /&gt;The "\b" is a "boundry" so that DEVELOP is replaced by PRODUCTION but not DEVELOPMENT.&lt;BR /&gt;&lt;BR /&gt;The switch '-pi.old' tells Perl to print and perform an inplace edit, first preserving a a copy of 'file' as 'file.old'.&lt;BR /&gt;&lt;BR /&gt;As you can otherwise see, the substitution syntax is similar to 'sed'.&lt;BR /&gt;&lt;BR /&gt;If you want to begin to learn Perl, a good start would be O'Reilly's "Learning Perl (3rd Ed)"  by by Randal L. Schwartz and Tom Phoenix.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Jul 2006 14:19:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833839#M11141</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-07-31T14:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833840#M11142</link>
      <description>&lt;!--!*#--&gt;Steven.&lt;BR /&gt;&lt;BR /&gt;I am not recommending this solution.  But for  the "old" dos edlin fans this worked on&lt;BR /&gt;my Windows 2000 [Version 5.00.2195] box&lt;BR /&gt;I could not resist showing this:&lt;BR /&gt;&lt;BR /&gt;Contents of text file to fix called test.txt:&lt;BR /&gt;C:\&amp;gt;type test.txt&lt;BR /&gt;This is a DEVPLOP system&lt;BR /&gt;This is a DEVPLOP system&lt;BR /&gt;This is a DEVPLOP system&lt;BR /&gt;THIS is a DEVPLOP system&lt;BR /&gt;&lt;BR /&gt;C:\&amp;gt;&lt;BR /&gt;The above file is CRLF terminated..&lt;BR /&gt;&lt;BR /&gt;I then create a file called doit, with edlin using the following line commands:&lt;BR /&gt;C:\&amp;gt;edlin doit&lt;BR /&gt;New file&lt;BR /&gt;*i&lt;BR /&gt;     1:*1RDEVPLOP^ZPRODUCTION&lt;BR /&gt;     2:*E&lt;BR /&gt;     3:*^Z&lt;BR /&gt;e&lt;BR /&gt;&lt;BR /&gt;C:\&amp;gt;&lt;BR /&gt;&lt;BR /&gt;^Z is "Ctrl"Z&lt;BR /&gt;I then ran the following command to change the test.txt "text":&lt;BR /&gt;&lt;BR /&gt;C:\&amp;gt;edlin test.txt &amp;lt; doit&lt;BR /&gt;End of input file&lt;BR /&gt;*1RDEVPLOP^ZPRODUCTION&lt;BR /&gt;      1:*This is a PRODUCTION system&lt;BR /&gt;      2: This is a PRODUCTION system&lt;BR /&gt;      3: This is a PRODUCTION system&lt;BR /&gt;      4: THIS is a PRODUCTION system&lt;BR /&gt;*E&lt;BR /&gt;&lt;BR /&gt;C:\&amp;gt;&lt;BR /&gt;&lt;BR /&gt;edlin renamed lower case test.txt to upper case TEST.TXT (and left a TEST.BAK copy)&lt;BR /&gt;&lt;BR /&gt;Thanks for letting me use edlin for the first time in many years...&lt;BR /&gt;&lt;BR /&gt;Rory&lt;BR /&gt;&lt;BR /&gt;On my box edlin can be found at&lt;BR /&gt;C:\WINNT\system32\edlin.exe&lt;BR /&gt;C:\WINNT\system32\dllcache\edlin.exe</description>
      <pubDate>Mon, 31 Jul 2006 22:54:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833840#M11142</guid>
      <dc:creator>Rory R Hammond</dc:creator>
      <dc:date>2006-07-31T22:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833841#M11143</link>
      <description>EDLIN! Nooooooo, the memories, the horror, the end is near! save your souls!&lt;BR /&gt;&lt;BR /&gt;;)</description>
      <pubDate>Tue, 01 Aug 2006 02:15:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833841#M11143</guid>
      <dc:creator>dirk dierickx</dc:creator>
      <dc:date>2006-08-01T02:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833842#M11144</link>
      <description>&lt;!--!*#--&gt;Dirk,&lt;BR /&gt;&lt;BR /&gt;I couldn't really believe it myself.  I even found edlin on my XP machine..  I truly have not used it for many years...  (I do admit that I have recently used UNIX ed ...)&lt;BR /&gt;&lt;BR /&gt;Do you think this revelation might be a MS plot to still our souls?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;:-} &lt;BR /&gt;&lt;BR /&gt;Rory&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Aug 2006 03:08:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833842#M11144</guid>
      <dc:creator>Rory R Hammond</dc:creator>
      <dc:date>2006-08-01T03:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833843#M11145</link>
      <description>Thanks for all help!&lt;BR /&gt;&lt;BR /&gt;But I cannot make words replace, either using dos sed, or perl command.&lt;BR /&gt;&lt;BR /&gt;All DEVELOP words remains.   Execution went through without error.   Syntac is corret.  Would that be the windows/dos character issue?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Aug 2006 09:53:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833843#M11145</guid>
      <dc:creator>Steven Chen_1</dc:creator>
      <dc:date>2006-08-01T09:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833844#M11146</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;the perl will work for shure.&lt;BR /&gt;- Did you get any error messages?&lt;BR /&gt;- You can create a small file as a test case and try.&lt;BR /&gt;- You can give as one matching line of that file for inspection.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Tue, 01 Aug 2006 10:10:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833844#M11146</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-08-01T10:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833845#M11147</link>
      <description>While the PERL syntax does not change, how quotes are interpreted by the host's shell (COMMAND.COM) are different.&lt;BR /&gt;&lt;BR /&gt;This should work under Windows:&lt;BR /&gt;&lt;BR /&gt;perl -i.save -p -e "s/DEVPLOP/PRODUCTION/g" file1 file2 ...&lt;BR /&gt;&lt;BR /&gt;Note the double vs. single quotes.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Aug 2006 10:12:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833845#M11147</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-01T10:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833846#M11148</link>
      <description>A. Clay,&lt;BR /&gt;&lt;BR /&gt;Thanks for the help.   It works, and it happens when I try "perl -pi.old -e 's/\bDEVELOP\b/PRODUCTION/gi' file&lt;BR /&gt;", which failed to replace any.&lt;BR /&gt;&lt;BR /&gt;Yours is simpler and working.&lt;BR /&gt;&lt;BR /&gt;But everybody's efforts are very appreciated.</description>
      <pubDate>Tue, 01 Aug 2006 11:00:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833846#M11148</guid>
      <dc:creator>Steven Chen_1</dc:creator>
      <dc:date>2006-08-01T11:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833847#M11149</link>
      <description>Hi Steven:&lt;BR /&gt;&lt;BR /&gt;Consider a file with these lines:&lt;BR /&gt;&lt;BR /&gt;this is DEVELOPMENT DEVELOP&lt;BR /&gt;DEVELOP&lt;BR /&gt;DEVELOPMENT&lt;BR /&gt;&lt;BR /&gt;# perl -ple 's/\bDEVELOP\b/PRODUCTION/gi' file&lt;BR /&gt;&lt;BR /&gt;...produces:&lt;BR /&gt;&lt;BR /&gt;this is DEVELOPMENT PRODUCTION&lt;BR /&gt;PRODUCTION&lt;BR /&gt;DEVELOPMENT&lt;BR /&gt;&lt;BR /&gt;...That is, "words" matching DEVELOP are replaced, not any string containing this sequence.  You were not very clear defining your requiremnents.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Aug 2006 11:13:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833847#M11149</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-08-01T11:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: DOS help</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833848#M11150</link>
      <description>You should note that your problems don't stem from Perl itself but rather from the command interpreter underwhich Perl is actually running. What you should really consider is a pure Perl script that would with prompt you for target/replacement pairs and the filename(s) OR parse the command line for those values. That way the underlying command interpreter would not interfere and you would have a truly portable solution. I am not going to craft such a script (and I hope no one else does either); that should be your task and you could then post your finished solution. Your goal is not to do these dumb string replacements but rather to learn enough so that you never have to ask how to do it again.</description>
      <pubDate>Tue, 01 Aug 2006 11:40:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/dos-help/m-p/3833848#M11150</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-08-01T11:40:34Z</dc:date>
    </item>
  </channel>
</rss>

