Not sure if this can help you...
#!/usr/bin/perl use strict; my $file_1 = <<EOF; 0001Hadrian 0002Claudius 0003Julian 0004Augustus 0005Severus 0006Constantine 0007Valentinian EOF my (%record, $count_line); my $page_number = 1; open( my $fh, "<", \$file_1 ) or die "Could not open file.\n"; while (<$fh>) { chomp; s/(\d{4})//; $record{$1}->{$_}->{'Master'}++; } close( $fh ); while (<DATA>) { chomp; s/(\d{4})//; $record{$1}->{$_}->{'Child'}++; } for my $i ( sort keys %record ) { for my $j ( sort keys %{ $record{$i} } ) { if ( defined( $record{$i}->{$j}->{'Master'} ) ) { print "\t\t\t$j\n"; } else { print "$j\n"; } $count_line++; if ( $count_line == 5 ) { print "\n\t\tPage is $page_number\n\n"; $page_number++; $count_line = 0; } } } __DATA__ 0001Legio IX 0001Legio VI 0001Ursa Minor 0002Veraculum 0002Thrace 0002Legio III 0003Persia 0003Londinium 0004Legio II 0005Caledonia 0005York 0006Christianity 0006Constantinople 0006Legio II 0007Julian 0007Legio VII

In reply to Re: scale of large data file and output them in certain format by bichonfrise74
in thread scale of large data file and output them in certain format by fseng

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.