<?xml version="1.0" encoding="windows-1252"?>
<node id="1007563" title="Re: Reading files n lines a time" created="2012-12-06 08:28:57" updated="2012-12-06 08:28:57">
<type id="11">
note</type>
<author id="352046">
ww</author>
<data>
<field name="doctext">
Depending on the way your files-which-need-to-be-read-four-lines-at-a-time (henceforward, "fwn") are formatted/organized and the consistency thereof, you might consider setting your &lt;c&gt;$/&lt;/c&gt; record separator...

&lt;p&gt;for ex, if data looks like:&lt;/p&gt;

&lt;c&gt;name
date
bill

name1
date1
bill1

...&lt;/c&gt;

&lt;p&gt;then setting &lt;c&gt;local $/="\n\n"&lt;/c&gt; will tell Perl that you want to read a paragraph from the fwn, where paragraph is defined as something ending in two consecutive newlines.  Better yet, the special case, &lt;c&gt;$/=""&lt;/c&gt; defines para somewhat more broadly and may be suitable to deal with your data.&lt;/p&gt;

&lt;p&gt;You'll find many examples here, if you merely SuperSearch for &lt;c&gt;$/&lt;/c&gt;&lt;/p&gt;</field>
<field name="root_node">
1007560</field>
<field name="parent_node">
1007560</field>
</data>
</node>
