How to divide results into several pages?

Hi All,

I am wondering if anyone can help me with this. I have a long list of results and I want to divide them into several pages. Any ideas of how to do this? I'm using perl languange.

eg:

Output file consist of 400 data then would like to divide it into 50 data per pages.

any help on how to get this to work.

Thanks for any help

If you are trying to insert a pagebreak every 50 lines, that's not too hard to do in perl:

$maxlines=50;
$linenum=0;
while (<STDIN>) {
  $linenum++;
  if ($linenum > $maxlines) {
    $linenum=0;
    print "^L";
  }
  print "$_";
}

(Untested)
You'll need to put an actual page break in there where it has ^L (ie don't copy-paste the ^ and the L characters, use a single control-L character).

Should do the job.

You can also do it using perl's rather nice 'format' option Perl format Primer (1/2)

control-L character is

ctrl+vl

without any pressing any shift key