<?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 - read between lines in a file in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-read-between-lines-in-a-file/m-p/3278566#M715380</link>
    <description>#perl -ne 'if(/line B/.../line C/){print}' inputfile&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 17 May 2004 14:17:52 GMT</pubDate>
    <dc:creator>Marvin Strong</dc:creator>
    <dc:date>2004-05-17T14:17:52Z</dc:date>
    <item>
      <title>Perl - read between lines in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-read-between-lines-in-a-file/m-p/3278563#M715377</link>
      <description>All,&lt;BR /&gt;I was wondering if anyone had a better way to read between lines in a file.  I can do it with a few loops, but it is messy and time consuming.  I'd like a better way.&lt;BR /&gt;&lt;BR /&gt;The file would be:&lt;BR /&gt;A&lt;BR /&gt;bunch of lines&lt;BR /&gt;B&lt;BR /&gt;bunch of lines&lt;BR /&gt;C&lt;BR /&gt;bunch of lines&lt;BR /&gt;D&lt;BR /&gt;&lt;BR /&gt;and I want the "bunch of lines" between line B and line C.  I will know what line B and line C are, but nothing else in the file.  &lt;BR /&gt;&lt;BR /&gt;Anybody know a really clean way to do this in Perl?</description>
      <pubDate>Mon, 17 May 2004 14:05:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-read-between-lines-in-a-file/m-p/3278563#M715377</guid>
      <dc:creator>ES UNIX Team</dc:creator>
      <dc:date>2004-05-17T14:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Perl - read between lines in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-read-between-lines-in-a-file/m-p/3278564#M715378</link>
      <description>open(INFILE,"&amp;lt;$INFILE")|| die;&lt;BR /&gt;while&lt;INFILE&gt;) {&lt;BR /&gt;  if (/$PAT1/ ... /$PAT2/ ) {&lt;BR /&gt;       print "$_";&lt;BR /&gt;  }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;this prints everyting between patern1 and patern2&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Scott&lt;/INFILE&gt;</description>
      <pubDate>Mon, 17 May 2004 14:11:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-read-between-lines-in-a-file/m-p/3278564#M715378</guid>
      <dc:creator>Scott Palmer_1</dc:creator>
      <dc:date>2004-05-17T14:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Perl - read between lines in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-read-between-lines-in-a-file/m-p/3278565#M715379</link>
      <description>This isn't a complete script but maybe something like this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;FLAG=N&lt;BR /&gt;LINE1="Text of line you want to start printing from"&lt;BR /&gt;LINE2="Text of line you want to stop printing"&lt;BR /&gt;while read LINE&lt;BR /&gt;do&lt;BR /&gt;if [ "${LINE}" = "${LINE2}" ] ; then&lt;BR /&gt;  FLAG=N&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;if [ "${FLAG}" = "Y" ] ; then&lt;BR /&gt;  echo ${LINE}&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;if [ "${LINE}" = "${LINE1}" ] ; then&lt;BR /&gt; FLAG=Y&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;done &amp;lt; inputfile&lt;BR /&gt;&lt;BR /&gt;I think something like that should work.  If that doesn't work it should be pretty close.</description>
      <pubDate>Mon, 17 May 2004 14:13:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-read-between-lines-in-a-file/m-p/3278565#M715379</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2004-05-17T14:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Perl - read between lines in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-read-between-lines-in-a-file/m-p/3278566#M715380</link>
      <description>#perl -ne 'if(/line B/.../line C/){print}' inputfile&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 17 May 2004 14:17:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-read-between-lines-in-a-file/m-p/3278566#M715380</guid>
      <dc:creator>Marvin Strong</dc:creator>
      <dc:date>2004-05-17T14:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Perl - read between lines in a file</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-read-between-lines-in-a-file/m-p/3278567#M715381</link>
      <description>To reword Marvins,&lt;BR /&gt; &lt;BR /&gt;perl -ne '$seq=/^B/../^C/; print if ($seq &amp;gt; 1 and substr($seq,-2) ne "E0")' inputfile&lt;BR /&gt; &lt;BR /&gt;This will exclude the "B" and "C" lines&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 17 May 2004 14:33:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-read-between-lines-in-a-file/m-p/3278567#M715381</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-05-17T14:33:00Z</dc:date>
    </item>
  </channel>
</rss>

