Hello!

Let me say first I've visisted this site for a long time: you guys are a great font of knowledge the the n00b programmer like myself.

And with that...

I am working a program at my internship for processing some huge text files(1.5 gig ish). The goal is to split the file into 200mb chunks for use in other programs.

Searching google we found some code to use that works well for splitting files ( "http://search.cpan.org/src/CWEST/ppt-0.14/bin/split" )

My question comes at the part...

while (read (INFILE, $chunk, $count) == $count) { $fh = nextfile ($prefix); print $fh $chunk; }

I want to edit this so that, when it hits the chunk size, it will keep going UNTIL it hits a certain string. Where it will then resume creating another chunk.

My confusion comes with how that while loop flag condition works. My experience with Perl ended before ever seeing something like this.

I would be grateful to be pointed to some resource or something to look up to set me in the right direction. As, well, I really would like to know what the heck I'm doing...heh...

Thanks,

Mertz


In reply to File Processing... by Anonymous Monk

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.