The most straightforward way is not to retrieve the number of lines at all. If the way lines are divided doesn't matter then you can split files the same way as you deal cards - one line to file 1, next to file 2, next to file 3, next to file 1, etc. If you need first 200 lines to go to file 1, next 200 to file 2 and the remaining 199 to file 3, then you'll have to count lines either by reading all lines into a list and counting it (if the file is small) or scan the file for new line characters and count them (and add 1).
Bookmarks