in reply to How do i split a file into given number of parts.

Since you're just writing them out, perhaps you can use the unix 'split' command?
# n files each with no more than 10000 lines
split --lines=10000 

# files contaning at most 1 meg
split --bytes=1m

  • Comment on Re: How do i split a file into given number of parts.