<?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: Ignore 1st adn 2nd in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033179#M756576</link>
    <description>Hi,&lt;BR /&gt;elimination before processing:&lt;BR /&gt;grep -v -e'^START' -e'^END' data.lis&lt;BR /&gt;&lt;BR /&gt;Eliminiation during processing:&lt;BR /&gt;while read record&lt;BR /&gt;do&lt;BR /&gt;if [ $"record"  = "START" ] -o [ "$record" = "END" ]&lt;BR /&gt;then&lt;BR /&gt;echo skipped record&lt;BR /&gt;else&lt;BR /&gt;echo process record&lt;BR /&gt;fi&lt;BR /&gt;done &amp;lt; data.lis</description>
    <pubDate>Mon, 12 Mar 2007 03:38:17 GMT</pubDate>
    <dc:creator>Peter Godron</dc:creator>
    <dc:date>2007-03-12T03:38:17Z</dc:date>
    <item>
      <title>Ignore 1st adn 2nd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033176#M756573</link>
      <description>Hi , &lt;BR /&gt;&lt;BR /&gt;I am trying to loop through a text file and I want to ignore the 1st and the last line in the file. HOw can I achive this without using tail and head.&lt;BR /&gt;&lt;BR /&gt;for example&lt;BR /&gt;&lt;BR /&gt;START|&lt;BR /&gt;1|RECV1_PLCMM_1_YYYYMMDD_HHMMSS_DATA.TXT|&lt;BR /&gt;2|RECV1_PLCMM_2_YYYYMMDD_HHMMSS_DATA.TXT|&lt;BR /&gt;3|RECV1_PLCMM_3_YYYYMMDD_HHMMSS_DATA.TXT|&lt;BR /&gt;4|RECV1_PLCMM_4_YYYYMMDD_HHMMSS_DATA.TXT|&lt;BR /&gt;5|RECV1_PLCMM_5_YYYYMMDD_HHMMSS_DATA.TXT|&lt;BR /&gt;END|&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I want to ignore START and END in the file.&lt;BR /&gt;&lt;BR /&gt;Could u pls help me with this</description>
      <pubDate>Mon, 12 Mar 2007 02:56:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033176#M756573</guid>
      <dc:creator>chinnaga</dc:creator>
      <dc:date>2007-03-12T02:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore 1st adn 2nd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033177#M756574</link>
      <description>Hey&lt;BR /&gt;&lt;BR /&gt;perl -lane 'print if !/START/ &amp;amp;&amp;amp; !/END/' &amp;lt; yourfile&lt;BR /&gt;&lt;BR /&gt;you can bind this in a loop...&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 12 Mar 2007 03:03:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033177#M756574</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2007-03-12T03:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore 1st adn 2nd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033178#M756575</link>
      <description>awk -F | '$1 != "START" &amp;amp;&amp;amp; $1 != "END" '{print $0}' ur_file_name&lt;BR /&gt;&lt;BR /&gt;-Santosh</description>
      <pubDate>Mon, 12 Mar 2007 03:28:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033178#M756575</guid>
      <dc:creator>SANTOSH S. MHASKAR</dc:creator>
      <dc:date>2007-03-12T03:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore 1st adn 2nd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033179#M756576</link>
      <description>Hi,&lt;BR /&gt;elimination before processing:&lt;BR /&gt;grep -v -e'^START' -e'^END' data.lis&lt;BR /&gt;&lt;BR /&gt;Eliminiation during processing:&lt;BR /&gt;while read record&lt;BR /&gt;do&lt;BR /&gt;if [ $"record"  = "START" ] -o [ "$record" = "END" ]&lt;BR /&gt;then&lt;BR /&gt;echo skipped record&lt;BR /&gt;else&lt;BR /&gt;echo process record&lt;BR /&gt;fi&lt;BR /&gt;done &amp;lt; data.lis</description>
      <pubDate>Mon, 12 Mar 2007 03:38:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033179#M756576</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2007-03-12T03:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore 1st adn 2nd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033180#M756577</link>
      <description>Hi,&lt;BR /&gt;or if your requirement is not tied to START/END phrase:&lt;BR /&gt;&lt;BR /&gt;# Get the number of lines in data file&lt;BR /&gt;a=`wc -l g.lis | cut -d' ' -f1`&lt;BR /&gt;# Subtract one for the last line&lt;BR /&gt;b=`echo "$a - 1" | bc`&lt;BR /&gt;# Echo all but the first and last line&lt;BR /&gt;sed -n "2,$b p" data.lis&lt;BR /&gt;&lt;BR /&gt;Please also read:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#33" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#33&lt;/A&gt; on how to reward any useful answers given to your questions.&lt;BR /&gt;&lt;BR /&gt;So far you have not awarded any points !&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Mar 2007 04:54:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033180#M756577</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2007-03-12T04:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore 1st adn 2nd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033181#M756578</link>
      <description>I think the easiest way it to stash the current record away and process the prior.&lt;BR /&gt;Start processing after the second to skip the first.&lt;BR /&gt;&lt;BR /&gt;In perl:&lt;BR /&gt;&lt;BR /&gt;perl -ne "print $last if $.&amp;gt;2; $last=$_" some-text-file&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Mar 2007 07:50:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033181#M756578</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-03-12T07:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore 1st adn 2nd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033182#M756579</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Here's another generalized way to skip the first and the last record in a file.  Notice that this is not dependent upon any pattern matching:&lt;BR /&gt;&lt;BR /&gt;# perl -ne 'print if $. &amp;gt; 1 and !eof' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 12 Mar 2007 07:57:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033182#M756579</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-03-12T07:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore 1st adn 2nd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033183#M756580</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;If you won't accept a particular language for your solution, then *say so* when you ask for help so that we don't waste our time!!!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 12 Mar 2007 09:00:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033183#M756580</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-03-12T09:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore 1st adn 2nd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033184#M756581</link>
      <description>I am sorry for the inconvience .</description>
      <pubDate>Mon, 12 Mar 2007 09:31:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ignore-1st-adn-2nd/m-p/5033184#M756581</guid>
      <dc:creator>chinnaga</dc:creator>
      <dc:date>2007-03-12T09:31:42Z</dc:date>
    </item>
  </channel>
</rss>

