<?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: Trim a file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049436#M434512</link>
    <description>Remove the first 5000?&lt;BR /&gt;&lt;BR /&gt;How many does that leave? 100?&lt;BR /&gt;&lt;BR /&gt;tail - 100 &amp;gt; tempfile&lt;BR /&gt;cat tempfile &amp;gt; origfile&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
    <pubDate>Mon, 28 May 2007 10:08:04 GMT</pubDate>
    <dc:creator>Geoff Wild</dc:creator>
    <dc:date>2007-05-28T10:08:04Z</dc:date>
    <item>
      <title>Trim a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049433#M434509</link>
      <description>We have a huge file that we need to remove the first 5000 lines from.  We can't use "sed" because we can't pipe it to a new file.  We need to remove the lines right from the original.  &lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Mon, 28 May 2007 09:43:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049433#M434509</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2007-05-28T09:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Trim a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049434#M434510</link>
      <description>Create a file called delete_lines.vi like this:&lt;BR /&gt;&lt;BR /&gt;:1,20 d&lt;BR /&gt;:wq&lt;BR /&gt;&lt;BR /&gt;Then run vi in this way:&lt;BR /&gt;&lt;BR /&gt;vi - trimfile &amp;lt; delete_lines.vi&lt;BR /&gt;&lt;BR /&gt;Basically, what you are doing is to run vi in "batch" mode executing the commands indicated in delete_lines.vi</description>
      <pubDate>Mon, 28 May 2007 09:54:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049434#M434510</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2007-05-28T09:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Trim a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049435#M434511</link>
      <description>The problem with vi is that the file is too large for the memory...otherwise he would just do a dd within vi.  Is there another way?</description>
      <pubDate>Mon, 28 May 2007 09:56:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049435#M434511</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2007-05-28T09:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Trim a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049436#M434512</link>
      <description>Remove the first 5000?&lt;BR /&gt;&lt;BR /&gt;How many does that leave? 100?&lt;BR /&gt;&lt;BR /&gt;tail - 100 &amp;gt; tempfile&lt;BR /&gt;cat tempfile &amp;gt; origfile&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Mon, 28 May 2007 10:08:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049436#M434512</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2007-05-28T10:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trim a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049437#M434513</link>
      <description>No, it leaves around 200,000....that is why I need to trim that file as is.  I cannot manipulate it and write it to another file.</description>
      <pubDate>Mon, 28 May 2007 10:10:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049437#M434513</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2007-05-28T10:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Trim a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049438#M434514</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# perl -ni.old -e 'next if 1..5000;print' file&lt;BR /&gt;&lt;BR /&gt;This will perform an "inplace" update of 'file' leaving an unmodified copy as 'file.old'.  If you don't want to save the unmodified copy, use :&lt;BR /&gt;&lt;BR /&gt;# perl -ne 'next if 1..5000;print' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 28 May 2007 10:15:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049438#M434514</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-05-28T10:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Trim a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049439#M434515</link>
      <description>One last try, with the ex editor this time:&lt;BR /&gt;&lt;BR /&gt;cat delete_lines.ex&lt;BR /&gt;1,5000 d&lt;BR /&gt;x&lt;BR /&gt;&lt;BR /&gt;ex - file &amp;lt; delete_lines.ex</description>
      <pubDate>Mon, 28 May 2007 10:21:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049439#M434515</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2007-05-28T10:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Trim a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049440#M434516</link>
      <description>Thanks for the responses guys....I went with James' as it was exactly what I was looking for.</description>
      <pubDate>Mon, 28 May 2007 10:24:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049440#M434516</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2007-05-28T10:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Trim a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049441#M434517</link>
      <description>I really need to learn perl right now! =(</description>
      <pubDate>Mon, 28 May 2007 10:25:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trim-a-file/m-p/5049441#M434517</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2007-05-28T10:25:26Z</dc:date>
    </item>
  </channel>
</rss>

