Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: split a file into number of file based on line count

by thiagu_mvt (Sexton)
on May 13, 2009 at 07:21 UTC ( #763694=note: print w/replies, xml ) Need Help??


in reply to split a file into number of file based on line count

In Perl you can read the input file into a array and find the length of the array.(everyline is a scalar now)divide that into 5 and write those into five files one by one in a loop.
  • Comment on Re: split a file into number of file based on line count

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://763694]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2023-03-31 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (76 votes). Check out past polls.

    Notices?