<?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: To remove lines using perl in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/to-remove-lines-using-perl/m-p/4724010#M655337</link>
    <description>Hi Calvin:&lt;BR /&gt;&lt;BR /&gt;# perl -ne 'print unless /&amp;amp;hour/' file&lt;BR /&gt;&lt;BR /&gt;...or in a 'while' loop:&lt;BR /&gt;&lt;BR /&gt;#  perl -e 'while (&amp;lt;&amp;gt;) {print unless /&amp;amp;hour/}' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Thu, 09 Dec 2010 12:45:00 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2010-12-09T12:45:00Z</dc:date>
    <item>
      <title>To remove lines using perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-remove-lines-using-perl/m-p/4724009#M655336</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;I am trying to remove line from a while when i have search for a particular sting.&lt;BR /&gt;i.e.&lt;BR /&gt;&lt;BR /&gt;&amp;amp;123&amp;amp;123&amp;amp;12314215&amp;amp;&amp;amp;abc123&lt;BR /&gt;&amp;amp;123&amp;amp;123&amp;amp;12314215&amp;amp;hour&amp;amp;abc112&lt;BR /&gt;&amp;amp;123&amp;amp;123&amp;amp;12314215&amp;amp;&amp;amp;abc115&lt;BR /&gt;&amp;amp;123&amp;amp;123&amp;amp;12314215&amp;amp;hour&amp;amp;abc113&lt;BR /&gt;&amp;amp;123&amp;amp;123&amp;amp;12314215&amp;amp;&amp;amp;abc115&lt;BR /&gt;&amp;amp;123&amp;amp;123&amp;amp;12314215&amp;amp;&amp;amp;abc115&lt;BR /&gt;&lt;BR /&gt;i would want to remove the lines which contains the whole string which contains hour and the results would be &lt;BR /&gt;&lt;BR /&gt;&amp;amp;123&amp;amp;123&amp;amp;12314215&amp;amp;&amp;amp;abc123&lt;BR /&gt;&amp;amp;123&amp;amp;123&amp;amp;12314215&amp;amp;&amp;amp;abc115&lt;BR /&gt;&amp;amp;123&amp;amp;123&amp;amp;12314215&amp;amp;&amp;amp;abc115&lt;BR /&gt;&amp;amp;123&amp;amp;123&amp;amp;12314215&amp;amp;&amp;amp;abc115</description>
      <pubDate>Thu, 09 Dec 2010 08:15:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-remove-lines-using-perl/m-p/4724009#M655336</guid>
      <dc:creator>Calvin Tan Tjin Wei</dc:creator>
      <dc:date>2010-12-09T08:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: To remove lines using perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-remove-lines-using-perl/m-p/4724010#M655337</link>
      <description>Hi Calvin:&lt;BR /&gt;&lt;BR /&gt;# perl -ne 'print unless /&amp;amp;hour/' file&lt;BR /&gt;&lt;BR /&gt;...or in a 'while' loop:&lt;BR /&gt;&lt;BR /&gt;#  perl -e 'while (&amp;lt;&amp;gt;) {print unless /&amp;amp;hour/}' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 09 Dec 2010 12:45:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-remove-lines-using-perl/m-p/4724010#M655337</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-12-09T12:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: To remove lines using perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-remove-lines-using-perl/m-p/4724011#M655338</link>
      <description>though the suggested&lt;BR /&gt;&lt;BR /&gt;$ perl -ne'/&amp;amp;hour/ or print' file.dta&lt;BR /&gt;&lt;BR /&gt;is fine, it is much easier with grep&lt;BR /&gt;&lt;BR /&gt;$ fgrep -v '&amp;amp;hour' file.dta&lt;BR /&gt;&lt;BR /&gt;There is a right tool for every problem. In many an occasion that would be perl, but imho, here it is not&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Thu, 09 Dec 2010 15:30:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-remove-lines-using-perl/m-p/4724011#M655338</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2010-12-09T15:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: To remove lines using perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-remove-lines-using-perl/m-p/4724012#M655339</link>
      <description>Hey;&lt;BR /&gt;&lt;BR /&gt;Both previous posts are correct.  I would probably use perl if I wanted to change original file or a 'grep -v' if I was piping the output to something else.&lt;BR /&gt;&lt;BR /&gt;perl -i -nle 'print unless (/&amp;amp;hour/)' ${file} &lt;BR /&gt;&lt;BR /&gt;would edit the file in place.&lt;BR /&gt;&lt;BR /&gt;grep -v '&amp;amp;hour' | while IFS=&amp;amp; read ...&lt;BR /&gt;&lt;BR /&gt;if you were going to do something with the output...&lt;BR /&gt;&lt;BR /&gt;That's the nice thing about UNIX; there's usually several 'right' answers - just depends on what you want to do.&lt;BR /&gt;&lt;BR /&gt;Doug O'Leary</description>
      <pubDate>Thu, 09 Dec 2010 16:13:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-remove-lines-using-perl/m-p/4724012#M655339</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2010-12-09T16:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: To remove lines using perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/to-remove-lines-using-perl/m-p/4724013#M655340</link>
      <description>&lt;!--!*#--&gt;HI (again):&lt;BR /&gt;&lt;BR /&gt;It occurs to me (since you problem description is so nebulous and abstract) that perhaps you want to perform some processing in the loop but skip over some records:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;    ...   &lt;BR /&gt;    next if /&amp;amp;hour/; # resume reading next record, if any&lt;BR /&gt;    ...&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 09 Dec 2010 22:05:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/to-remove-lines-using-perl/m-p/4724013#M655340</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-12-09T22:05:46Z</dc:date>
    </item>
  </channel>
</rss>

