FWIW, I wrote a quickie tool that does this sort of thing some years ago. You can find it here: http://archive.midrange.com/rpg400-l/200408/msg00372.html
It took almost no time to write.
However, I do agree that just about every language out there has something like the %SPLIT that Danilo suggested, and it's too bad RPG doesn't. .