Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by Bloodnok (Vicar)
on May 13, 2009 at 10:02 UTC ( [id://763710]=note: print w/replies, xml ) Need Help??


in reply to Re^2: split a file into number of file based on line count
in thread split a file into number of file based on line count

Why do all that when you can equally well use
split -n 100 some_file
??

See man split... (on some *NIXes, -l is used instead of -n to specify the line count)

Update:

Qualified the usage of the line count option

A user level that continues to overstate my experience :-))

Replies are listed 'Best First'.
Re^4: split a file into number of file based on line count
by ww (Archbishop) on May 13, 2009 at 12:01 UTC
    Not general. See OP's ref to counting lines.
      Good point, well made ww :-D

      It's a classic case of me seeing what I wanted to - I saw ...split that file into 5 file each should contain 100 lines... and tho' I saw the subsequent narrative (fully defining the problem), I completely ignored it !!

      Glad it wasn't an exam :-D

      A user level that continues to overstate my experience :-))

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-19 22:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found