Just thought that I'd point out a few other aspects that you might want to consider.

Although it looks like you're wanting to reduce the CSV file by limiting the number of lines in each new CSV file (which will become rows in Excel), I thought that I'd point out that Excel has a max number of both columns and rows that it can handle. The max number of columns and rows supported will vary across versions of Excel. The reason for bring up this point is that if your original CSV file has more columns than what is supported by Excel, all of the split CSV files that you create from the original will have the same issue when trying to open in Excel.

Also, does the first line of the CSV file contain the column headers? If so, you'll want to capture that first line and reproduce it as the first line in all of your new CSV files. Otherwise, only the first new file will have the headers.


In reply to Re: split large CSV file >9.1MB into files of equal size that can be opened in excel by dasgar
in thread split large CSV file >9.1MB into files of equal size that can be opened in excel 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.