Thanks Kenneth, and all the other responders.
I just wanted to make sure that my suspicion that there was an easy way to do this that wasn't long and ugly, but also not profoundly obfuscated was correct, or not correct.
Like the "just use a split" answer, which if the input was uniform, would of course been the correct answer.
Thanks all, I've got what I need.
-- rob