<?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: Strip bottom of text file based on pattern in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/strip-bottom-of-text-file-based-on-pattern/m-p/5030614#M97826</link>
    <description>I received two replies which both are solutions to my question.</description>
    <pubDate>Mon, 26 Feb 2007 15:04:31 GMT</pubDate>
    <dc:creator>Tom Weber_4</dc:creator>
    <dc:date>2007-02-26T15:04:31Z</dc:date>
    <item>
      <title>Strip bottom of text file based on pattern</title>
      <link>https://community.hpe.com/t5/operating-system-linux/strip-bottom-of-text-file-based-on-pattern/m-p/5030609#M97821</link>
      <description>I'm trying to think of the best way (awk, sed, perl, etc.) to cut off the bottom of a text file when it encounters a certain pattern.  Let's say a 100 line text file and if it sees a certain word or phrase, return only the lines above the pattern.&lt;BR /&gt;&lt;BR /&gt;So if it finds the pattern in line 67, return the first 66 lines.&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Mon, 26 Feb 2007 14:22:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/strip-bottom-of-text-file-based-on-pattern/m-p/5030609#M97821</guid>
      <dc:creator>Tom Weber_4</dc:creator>
      <dc:date>2007-02-26T14:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Strip bottom of text file based on pattern</title>
      <link>https://community.hpe.com/t5/operating-system-linux/strip-bottom-of-text-file-based-on-pattern/m-p/5030610#M97822</link>
      <description>How about:&lt;BR /&gt;&lt;BR /&gt;sed '/the word/,$d' &amp;lt; input.txt&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Wout</description>
      <pubDate>Mon, 26 Feb 2007 14:53:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/strip-bottom-of-text-file-based-on-pattern/m-p/5030610#M97822</guid>
      <dc:creator>Wouter Jagers</dc:creator>
      <dc:date>2007-02-26T14:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Strip bottom of text file based on pattern</title>
      <link>https://community.hpe.com/t5/operating-system-linux/strip-bottom-of-text-file-based-on-pattern/m-p/5030611#M97823</link>
      <description>Hi Tom:&lt;BR /&gt;&lt;BR /&gt;# perl -pe 'last if /pattern/' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 26 Feb 2007 14:56:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/strip-bottom-of-text-file-based-on-pattern/m-p/5030611#M97823</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-02-26T14:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Strip bottom of text file based on pattern</title>
      <link>https://community.hpe.com/t5/operating-system-linux/strip-bottom-of-text-file-based-on-pattern/m-p/5030612#M97824</link>
      <description>That was quick!  I knew someone out there would be all over it.  Thank you!</description>
      <pubDate>Mon, 26 Feb 2007 14:58:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/strip-bottom-of-text-file-based-on-pattern/m-p/5030612#M97824</guid>
      <dc:creator>Tom Weber_4</dc:creator>
      <dc:date>2007-02-26T14:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Strip bottom of text file based on pattern</title>
      <link>https://community.hpe.com/t5/operating-system-linux/strip-bottom-of-text-file-based-on-pattern/m-p/5030613#M97825</link>
      <description>Thanks Wout and James!  Both solutions work just fine.</description>
      <pubDate>Mon, 26 Feb 2007 15:03:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/strip-bottom-of-text-file-based-on-pattern/m-p/5030613#M97825</guid>
      <dc:creator>Tom Weber_4</dc:creator>
      <dc:date>2007-02-26T15:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Strip bottom of text file based on pattern</title>
      <link>https://community.hpe.com/t5/operating-system-linux/strip-bottom-of-text-file-based-on-pattern/m-p/5030614#M97826</link>
      <description>I received two replies which both are solutions to my question.</description>
      <pubDate>Mon, 26 Feb 2007 15:04:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/strip-bottom-of-text-file-based-on-pattern/m-p/5030614#M97826</guid>
      <dc:creator>Tom Weber_4</dc:creator>
      <dc:date>2007-02-26T15:04:31Z</dc:date>
    </item>
  </channel>
</rss>

