in reply to splitting files by number of words

First go through the file, counting the number of words. Divide that value by ten.

Then go through the file once again, this time stopping when you need to split, open a new file, and write the next words to it

It's no rocket science - try it, and if have problems to code some of this, come back with more specific questions.