running activestate perl 5.6.1 build 631 on win2k.

I have a 7.5 gig file from a database with 40,000,000 or so records (1 per line). I need to check each record in the file (using a regex) and then write the validated/corrected data out to files of 1,000,000 records each. I am reading the source file one line at a time (while(<SOURCE>){etc...};), processing the record and then appending it to the output file. after i print the 1,000,000th record i close the destination handle and open a new file and continue to print to it, etc... but when i get to the 10,546,603rd record (about 2 gigs into it) the program exits. Even if i just count the lines, the same thing happens. the last line it reads is a truncated record and no \n. I'm sure that isn't the last line in the file, and I was able to successfully import all of the records back into MS SQL server.

any ideas?

In reply to Trouble with VERY large file by PapaMonzano

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.