<?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: Perl Help in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876259#M69403</link>
    <description>You can try the following&lt;BR /&gt;&lt;BR /&gt;perl -ni.orig -e 'print if $. &amp;gt; 15' &lt;FILE&gt; ...&lt;BR /&gt;&lt;BR /&gt;It should delete first 15 lines in &lt;FILE&gt; and leave original in &lt;FILE&gt;.orig.&lt;/FILE&gt;&lt;/FILE&gt;&lt;/FILE&gt;</description>
    <pubDate>Tue, 21 Dec 2004 00:00:11 GMT</pubDate>
    <dc:creator>Ermin Borovac</dc:creator>
    <dc:date>2004-12-21T00:00:11Z</dc:date>
    <item>
      <title>Perl Help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876258#M69402</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I am trying to delete the first 15 lines from each text file I have.  Is there a easy perl script for this?&lt;BR /&gt;&lt;BR /&gt;The attached file is similar to the text file I am working with.  It is always going to be the first 15 lines.</description>
      <pubDate>Mon, 20 Dec 2004 23:25:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876258#M69402</guid>
      <dc:creator>Shaf_1</dc:creator>
      <dc:date>2004-12-20T23:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876259#M69403</link>
      <description>You can try the following&lt;BR /&gt;&lt;BR /&gt;perl -ni.orig -e 'print if $. &amp;gt; 15' &lt;FILE&gt; ...&lt;BR /&gt;&lt;BR /&gt;It should delete first 15 lines in &lt;FILE&gt; and leave original in &lt;FILE&gt;.orig.&lt;/FILE&gt;&lt;/FILE&gt;&lt;/FILE&gt;</description>
      <pubDate>Tue, 21 Dec 2004 00:00:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876259#M69403</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2004-12-21T00:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876260#M69404</link>
      <description>Hello Ermin,&lt;BR /&gt;&lt;BR /&gt;I tried this since I am trying to run it for over 1000 files at once.  But what is happening is that it only update the first file.&lt;BR /&gt;&lt;BR /&gt;perl -i -n -e 'print if$. &amp;gt; 15;' *.txt&lt;BR /&gt;&lt;BR /&gt;What could I be doing wrong?</description>
      <pubDate>Tue, 21 Dec 2004 00:14:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876260#M69404</guid>
      <dc:creator>Shaf_1</dc:creator>
      <dc:date>2004-12-21T00:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876261#M69405</link>
      <description>Just do it in a loop instead&lt;BR /&gt;&lt;BR /&gt;for file in *.txt&lt;BR /&gt;do&lt;BR /&gt;perl -ni.orig -e 'print if $. &amp;gt; 15' $file&lt;BR /&gt;done</description>
      <pubDate>Tue, 21 Dec 2004 00:22:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876261#M69405</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2004-12-21T00:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876262#M69406</link>
      <description>Here's the desired perl script:&lt;BR /&gt;foreach $file (glob "*.txt") {&lt;BR /&gt; @ARGV=$file;&lt;BR /&gt; $^I=".bak";#creates backup with .bak extension&lt;BR /&gt; while (&amp;lt;&amp;gt;) {&lt;BR /&gt;  if ($.&amp;gt;15) { &lt;BR /&gt;         print;&lt;BR /&gt;   }&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;By the way for any perl question refer to:&lt;BR /&gt;&lt;A href="http://www.perlmonks.org" target="_blank"&gt;www.perlmonks.org&lt;/A&gt;&lt;BR /&gt;Best and quick answers.</description>
      <pubDate>Tue, 21 Dec 2004 03:23:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876262#M69406</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2004-12-21T03:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876263#M69407</link>
      <description>"PERL oneliners" provides me with answers to 90% of  my PERL needs:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www-106.ibm.com/developerworks/linux/library/l-p102.html" target="_blank"&gt;http://www-106.ibm.com/developerworks/linux/library/l-p102.html&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.unixguide.net/unix/perl_oneliners.shtml" target="_blank"&gt;http://www.unixguide.net/unix/perl_oneliners.shtml&lt;/A&gt;</description>
      <pubDate>Tue, 21 Dec 2004 04:43:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876263#M69407</guid>
      <dc:creator>Vitaly Karasik_1</dc:creator>
      <dc:date>2004-12-21T04:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876264#M69408</link>
      <description>This one liner works for one file at a time. &lt;BR /&gt;&lt;BR /&gt; # delete first 10 lines &lt;BR /&gt;Â&amp;nbsp;Â&amp;nbsp; perl -i.old -ne 'print unless 1 .. 10' foo.txt &lt;BR /&gt;&lt;BR /&gt;Is there a easy way to run it for a bunch of files at once?&lt;BR /&gt;&lt;BR /&gt;Does it matter what shell I am</description>
      <pubDate>Tue, 21 Dec 2004 15:28:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876264#M69408</guid>
      <dc:creator>Shaf_1</dc:creator>
      <dc:date>2004-12-21T15:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876265#M69409</link>
      <description>Just replace your filespec with a wild-carded on like *.txt&lt;BR /&gt;&lt;BR /&gt;See for example:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.rice.edu/web/perl-edit.html" target="_blank"&gt;http://www.rice.edu/web/perl-edit.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The only tricky part with that iss to recognize file transitions, where you'll need to reset the line number for the work you want to do.&lt;BR /&gt;&lt;BR /&gt;So a solution might be:&lt;BR /&gt;&lt;BR /&gt;perl -ni.old -e 'print unless ($.&amp;lt;10); close ARGV if eof' *.txt&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Dec 2004 19:59:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876265#M69409</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-12-21T19:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876266#M69410</link>
      <description>sed '1,15d' textfile</description>
      <pubDate>Thu, 23 Dec 2004 10:01:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876266#M69410</guid>
      <dc:creator>NiCK_76</dc:creator>
      <dc:date>2004-12-23T10:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876267#M69411</link>
      <description>Thanks for all the help.</description>
      <pubDate>Sun, 09 Jan 2005 17:49:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-help/m-p/4876267#M69411</guid>
      <dc:creator>Shaf_1</dc:creator>
      <dc:date>2005-01-09T17:49:12Z</dc:date>
    </item>
  </channel>
</rss>

