http://qs321.pair.com?node_id=971969


in reply to Help with problem

I've tried out your script, just changed the 300000 to 50 for easier debugging. The first output file has 51 lines (because you only stop writing when the line count is greater than your desired limit), all following files have 52 lines (because you don't count the first line being written).

So I guess that the script is mostly working the way you want, but something's wrong with your testing of the script.