Program to split very large files by line count

Discussion in 'C++' started by Curious Joe, Nov 10, 2006.

  1. Curious Joe

    Curious Joe Guest

    I have some files that are anywhere from 3GB to 9GB and I need to split
    them down to a series of smaller files similar to what the "split"
    command in linux can do. Unfortunately, I do not have access to a
    linux machine right now. I have been told that a program could be
    written in C/C++ that would do this very quickly.

    Can anyone point me to a tutorial or how-to that will teach me to write
    a quick program do accomplish this?

    for example

    split.exe <file.to.split> <output.filename.prefix>
    <number.of.lines.per.file>

    split.exe bigfile.txt bigfile_ 1000000

    Thanks,

    CJ
    Curious Joe, Nov 10, 2006
    #1
    1. Advertising

  2. Curious Joe wrote:
    > I have some files that are anywhere from 3GB to 9GB and I need to split
    > them down to a series of smaller files similar to what the "split"
    > command in linux can do. Unfortunately, I do not have access to a
    > linux machine right now. I have been told that a program could be
    > written in C/C++ that would do this very quickly.
    >
    > Can anyone point me to a tutorial or how-to that will teach me to write
    > a quick program do accomplish this?
    >
    > for example
    >
    > split.exe <file.to.split> <output.filename.prefix>
    > <number.of.lines.per.file>
    >
    > split.exe bigfile.txt bigfile_ 1000000
    >

    Try installing mingw. It probably has the GNU splut command there.
    Gianni Mariani, Nov 10, 2006
    #2
    1. Advertising

  3. Curious Joe

    BobR Guest

    Gianni Mariani wrote in message
    <4553cfdd$0$3059$>...
    >Curious Joe wrote:
    >> I have some files that are anywhere from 3GB to 9GB and I need to split
    >> them down to a series of smaller files similar to what the "split"
    >> command in linux can do. Unfortunately, I do not have access to a
    >> linux machine right now. I have been told that a program could be
    >> written in C/C++ that would do this very quickly.
    >>
    >> Can anyone point me to a tutorial or how-to that will teach me to write
    >> a quick program do accomplish this?
    >>
    >> for example
    >>
    >> split.exe <file.to.split> <output.filename.prefix>
    >> <number.of.lines.per.file>
    >>
    >> split.exe bigfile.txt bigfile_ 1000000
    >>

    >Try installing mingw. It probably has the GNU splut command there.


    "split.exe" is in 'Msys'.

    --
    Bob R
    POVrookie
    BobR, Nov 10, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arsen V.
    Replies:
    5
    Views:
    346
    bruce barker
    Feb 3, 2004
  2. Raymond Arthur St. Marie II of III

    very Very VERY dumb Question About The new Set( ) 's

    Raymond Arthur St. Marie II of III, Jul 23, 2003, in forum: Python
    Replies:
    4
    Views:
    453
    Raymond Hettinger
    Jul 27, 2003
  3. shanx__=|;-

    very very very long integer

    shanx__=|;-, Oct 16, 2004, in forum: C Programming
    Replies:
    19
    Views:
    1,594
    Merrill & Michele
    Oct 19, 2004
  4. Abhishek Jha

    very very very long integer

    Abhishek Jha, Oct 16, 2004, in forum: C Programming
    Replies:
    4
    Views:
    410
    jacob navia
    Oct 17, 2004
  5. Split a very large log file

    , Feb 2, 2007, in forum: Perl Misc
    Replies:
    2
    Views:
    109
Loading...

Share This Page