Open the input file
Open the first output file
Read a line
Count it
Write the line
Read a line
Count it
Write the line
Read a line
Count it
Write the line
-- when the count gets to one of your magic numbers
Close the output file
Open the next output file
Continue reading, counting, writing...
WaltP
Posting Sage w/ dash of thyme
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944