Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 ( [id://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?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-06-20 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.