How to split a document

Hi.. Does anybody knows how can I split a file in N documents?? I have a document of more than 80,000 lines (it is generated in a dynamic way, sometimes has 80,000 others 30,000 , or 1000,000) Im trying tyo break this file in only 1 lines of commands but I want to break it in a N differents files of (nearly) the same lines equally, so I need to check the number of lines of this file and after that split it in N differents files with the same number of lines, this is beause I need to have pararel process working each one of this files.

I know about the wc -l command return the number of lines, and the split command split -l XXXXX thefile ..

how can I pipe this commands in order to have N files of the same time on a dynamic way???

Thanks

Hello gtapia

You can try this command:

split -l `wc -l yourfile | awk '{print $1/N'` yourfile

You can replace N by any number.

Thanks JoBa it works!!!!

See you!:smiley: