Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Split file into 4 smaller ones

by Anonymous Monk
on Feb 08, 2013 at 07:13 UTC ( #1017774=note: print w/replies, xml ) Need Help??

in reply to Split file into 4 smaller ones

May I recommend the Unix utility split (1)?

     split -- split a file into pieces

     split [-a suffix_length] [-b byte_count[k|m] | -l line_count -n
           chunk_count] [file [name]]

     The split utility reads the given file and breaks it up into files of
     1000 lines each.  If file is a single dash or absent, split reads from
     the standard input.  file itself is not altered.

     The options are as follows:


     -n      Split file into chunk_count smaller files.

Okay, maybe that was a bad suggestion. The GNU version does not have a split-to-n-chunks feature, it seems.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1017774]
[choroba]: The only problem you can't solve by adding more tests is the problem of having too many tests.
[stevieb]: choroba Been there, done that :) Better too many than not enough though!
[stevieb]: I very often write a base set of unit tests before writing any code. It helps dictate the API, and ensures my earliest of ideas stay on track.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2017-07-21 20:05 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (335 votes). Check out past polls.