<?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: Sed and awk help needed in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981869#M122276</link>
    <description>Thanks for all the help. Worked great.</description>
    <pubDate>Tue, 27 May 2003 18:13:41 GMT</pubDate>
    <dc:creator>James Andertom</dc:creator>
    <dc:date>2003-05-27T18:13:41Z</dc:date>
    <item>
      <title>Sed and awk help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981862#M122269</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I have been trying to work out a solution using sed and awk on a file but am having no joy. I am hoping someone can help me.&lt;BR /&gt;&lt;BR /&gt;I have a text file which is like the following:&lt;BR /&gt;&lt;BR /&gt;DESCRIPTION "OV_Testing"&lt;BR /&gt;CONDITION_ID "nnndjdj"&lt;BR /&gt;CONDITION "JDJKDKDK"&lt;BR /&gt;$e "jdjdjdj"&lt;BR /&gt;$G jsjdj&lt;BR /&gt;$S 5606060&lt;BR /&gt;SET&lt;BR /&gt;SERVERLOGONLY&lt;BR /&gt;SEVERITY Normal&lt;BR /&gt;NODE IP kkdkdkdk&lt;BR /&gt;OBJECT "&amp;lt;$2&amp;gt;"&lt;BR /&gt;&lt;BR /&gt;In the file I need to search for all the occurences of OV_Testing and then change the OBJECT "&amp;lt;$2&amp;gt;" to OBJECT "&amp;lt;$r&amp;gt;". &lt;BR /&gt;&lt;BR /&gt;I can match the OV_Testing without any problems but I do not know how to change the value of OBJECT when I have matched the OV_Testing field in the block of text.&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 May 2003 14:44:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981862#M122269</guid>
      <dc:creator>James Andertom</dc:creator>
      <dc:date>2003-05-26T14:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sed and awk help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981863#M122270</link>
      <description># perl -pi.prv -e's/OBJECT "&amp;lt;\$2&amp;gt;"/OBJECT "&amp;lt;\$r&amp;gt;"/g' your_file&lt;BR /&gt;&lt;BR /&gt;Enjoy, have FUN! H.Merijn</description>
      <pubDate>Mon, 26 May 2003 15:08:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981863#M122270</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-05-26T15:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sed and awk help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981864#M122271</link>
      <description>Or,&lt;BR /&gt;let say the file is named goofy&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cat goffy | awk '/OV_Testing/, /\$2/' | sed s.\$2.whatdoyouwant. &amp;gt; destination&lt;BR /&gt;&lt;BR /&gt;now destination keeps the modified nodes.&lt;BR /&gt;&lt;BR /&gt;you can merge this with the source goofy, for example using diff .&lt;BR /&gt;&lt;BR /&gt;Just an hint...&lt;BR /&gt; HTH,&lt;BR /&gt;   Massimo&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 May 2003 15:28:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981864#M122271</guid>
      <dc:creator>Massimo Bianchi</dc:creator>
      <dc:date>2003-05-26T15:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sed and awk help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981865#M122272</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# sed -e '/OV_Testing/,/OBJECT/ s/"&amp;lt;$2&amp;gt;"/"&amp;lt;$r&amp;gt;"/'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 26 May 2003 15:38:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981865#M122272</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-05-26T15:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sed and awk help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981866#M122273</link>
      <description>:) JRF's posting better explained to me what was needed than the quest itself :) [ Or I did bad reading ]&lt;BR /&gt;&lt;BR /&gt;# perl -pi.prv -e'm/^DESCRIPTION "([^"]+)/ and$desc=$1;m/^OBJECT/&amp;amp;&amp;amp;$desc eq"OV_Testing"and s/&amp;lt;\$2&amp;gt;/&amp;lt;\$r&amp;gt;/' your_file&lt;BR /&gt;&lt;BR /&gt;Much better. (sed is shorter, but this was inline editing)&lt;BR /&gt;&lt;BR /&gt;Enjoy, have FUN! H.Merijn</description>
      <pubDate>Mon, 26 May 2003 15:46:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981866#M122273</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-05-26T15:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sed and awk help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981867#M122274</link>
      <description>Hi Merijn:&lt;BR /&gt;&lt;BR /&gt;Thanks, but of course, I neglected to show that, unlike with perl, no inline editing is possible :-))&lt;BR /&gt;&lt;BR /&gt;Hence, I would write:&lt;BR /&gt;&lt;BR /&gt;# sed -e '/OV_Testing/,/OBJECT/ s/"&amp;lt;$2&amp;gt;"/"&amp;lt;$r&amp;gt;"/' filename &amp;gt; filename.new&lt;BR /&gt;&lt;BR /&gt;# mv filename.new filename&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Mon, 26 May 2003 16:09:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981867#M122274</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-05-26T16:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sed and awk help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981868#M122275</link>
      <description>try this&lt;BR /&gt;&lt;BR /&gt;cat file | sed 's/OBJECT \"&amp;lt;\$2&amp;gt;\"/\"&amp;lt;\$r&amp;gt;\"/g' &amp;gt; outfile</description>
      <pubDate>Tue, 27 May 2003 10:13:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981868#M122275</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-05-27T10:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sed and awk help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981869#M122276</link>
      <description>Thanks for all the help. Worked great.</description>
      <pubDate>Tue, 27 May 2003 18:13:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-and-awk-help-needed/m-p/2981869#M122276</guid>
      <dc:creator>James Andertom</dc:creator>
      <dc:date>2003-05-27T18:13:41Z</dc:date>
    </item>
  </channel>
</rss>

