How do I convert a multisite with sub-domains to a multi-site with sub-directories?

Well, the subject line sums it all up, but here's the background.

I'm moving a multisite network to a host without wildcard sub-domain support. It has to be done due to costs. I know that it is more desirable to have a VPS type set up, but I need to move to shared hosting - specifically hosting - without wildcard sub-domains.

It matters not for this network. It isn't profitable, I'm not getting paid to host it, those who use it will have to put up with the change.

So, the question is, how do I change this multi-site sub-domain network to a multisite sub-directory one?

Thanks in advance.