Generally speaking the idea has been to use the year close transformation to do this at reporting time, and not bake this into any file (it's really a reporting thing).
But I think I did hack a script at some point to output the transactions you'd insert to actually bake the splits into files.
Search in /experimental, should be in there somewhere, I don't think it ever made it to tried-tested-and-true status.
If you can't find it, you can easily just write a script to iterate over all your date-sorted transactions in order and accumulate balances in a dict of Inventory objects, and stop at the given date, and process that to find the balances to insert. Should be something like 30 LOC.