<?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: modify string into file in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/modify-string-into-file/m-p/3643740#M69072</link>
    <description>&lt;BR /&gt;use sed or awk command scripts.&lt;BR /&gt;&lt;BR /&gt;you can also do string replacement using perl scripts.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Gopi</description>
    <pubDate>Fri, 07 Oct 2005 00:55:50 GMT</pubDate>
    <dc:creator>Gopi Sekar</dc:creator>
    <dc:date>2005-10-07T00:55:50Z</dc:date>
    <item>
      <title>modify string into file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/modify-string-into-file/m-p/3643738#M69070</link>
      <description>Red Hat Enterprise Linux 3&lt;BR /&gt;&lt;BR /&gt;How can I modify certain string which is into a file? (using just a command line statament).&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Oct 2005 16:34:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/modify-string-into-file/m-p/3643738#M69070</guid>
      <dc:creator>Tonatiuh</dc:creator>
      <dc:date>2005-10-06T16:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: modify string into file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/modify-string-into-file/m-p/3643739#M69071</link>
      <description>You can do it to another file using sed. Like this:&lt;BR /&gt;&lt;BR /&gt;sed s/search_string/replacement_string file&lt;BR /&gt;&lt;BR /&gt;sed s/hello/goodbye myfile &amp;gt; myfile2&lt;BR /&gt;&lt;BR /&gt;You can then rename or move the new file.</description>
      <pubDate>Thu, 06 Oct 2005 16:57:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/modify-string-into-file/m-p/3643739#M69071</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2005-10-06T16:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: modify string into file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/modify-string-into-file/m-p/3643740#M69072</link>
      <description>&lt;BR /&gt;use sed or awk command scripts.&lt;BR /&gt;&lt;BR /&gt;you can also do string replacement using perl scripts.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Gopi</description>
      <pubDate>Fri, 07 Oct 2005 00:55:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/modify-string-into-file/m-p/3643740#M69072</guid>
      <dc:creator>Gopi Sekar</dc:creator>
      <dc:date>2005-10-07T00:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: modify string into file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/modify-string-into-file/m-p/3643741#M69073</link>
      <description>You can use perl -pi -e 's/&lt;STRING&gt;/&lt;CHANGESTRING&gt;/g' &lt;FILENAME&gt;. It will automatically update into the same file without any string.&lt;BR /&gt;&lt;BR /&gt;# Example:&lt;BR /&gt;&lt;BR /&gt;file1:&lt;BR /&gt;&lt;BR /&gt;hi&lt;BR /&gt;bye&lt;BR /&gt;&lt;BR /&gt;# perl -pi -e 's/hi/first/g' file1&lt;BR /&gt;&lt;BR /&gt;file1:&lt;BR /&gt;&lt;BR /&gt;first&lt;BR /&gt;bye&lt;BR /&gt;&lt;BR /&gt;hth.&lt;/FILENAME&gt;&lt;/CHANGESTRING&gt;&lt;/STRING&gt;</description>
      <pubDate>Fri, 07 Oct 2005 01:44:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/modify-string-into-file/m-p/3643741#M69073</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-07T01:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: modify string into file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/modify-string-into-file/m-p/3643742#M69074</link>
      <description>Just an short explanation to Muthukumars reply&lt;BR /&gt;perl -pi -e 's/&lt;STRING&gt;/&lt;CHANGESTRING&gt;/g' &lt;FILENAME&gt;. &lt;BR /&gt;&lt;BR /&gt;-p -&amp;gt; assumes the following loop around your script. while (&amp;lt;&amp;gt;) { &lt;BR /&gt;# your script goes here &lt;BR /&gt;} continue { &lt;BR /&gt;print or die "-p destination: $!\n"; &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;-i -&amp;gt; specifies that files processed by the &amp;lt;&amp;gt; construct are to be edited in-place&lt;BR /&gt;&lt;BR /&gt;-e -&amp;gt; Specifies a line of script.&lt;BR /&gt;&lt;BR /&gt;More details are in the man page.Hope it helps.&lt;/FILENAME&gt;&lt;/CHANGESTRING&gt;&lt;/STRING&gt;</description>
      <pubDate>Fri, 07 Oct 2005 06:45:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/modify-string-into-file/m-p/3643742#M69074</guid>
      <dc:creator>Guru Dutta</dc:creator>
      <dc:date>2005-10-07T06:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: modify string into file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/modify-string-into-file/m-p/3643743#M69075</link>
      <description>This may be more difficult but works too, use a script wiht vi.&lt;BR /&gt;&lt;BR /&gt;Create the script called script.vi:&lt;BR /&gt;&lt;BR /&gt;^[:%s/string/replacement_string/g&lt;BR /&gt;^[:wq&lt;BR /&gt;&lt;BR /&gt;The ^[: is created pressing CTRL+v and ENTER.&lt;BR /&gt;&lt;BR /&gt;Then run&lt;BR /&gt;&lt;BR /&gt;vi -s script.vi file_to_modify&lt;BR /&gt;&lt;BR /&gt;The modifications will be done directly in the file.</description>
      <pubDate>Fri, 07 Oct 2005 11:27:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/modify-string-into-file/m-p/3643743#M69075</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2005-10-07T11:27:05Z</dc:date>
    </item>
  </channel>
</rss>

