I have a zip archive containing a big directory tree with many files. I'm using an application that does something with zip archives. The problem is that the application has a limitation on how many files the archive contains, and my archive has too many files. In order to use the application I need to split the archive into two sub-archives. That would have been easy had the archive directory tree been a flat list of files (if that were the case I would've cut it in the middle and split). The problem is that my archive contains a complex directory tree, and I can't find a way to split it in such a way that each part has an approximately equal number of files.
How can I split the archive so that each sub-archive has about half the files of the original archive?
Note that I have to be able to join the sub-archives together after splitting them.