Would sscanf not do the trick? Never actually tried something like this before, i'm sure i've seen it done though.
I've never really used sscanf to separate data, I'm sure it's possible, just don't have the experience to make it happen. Do you know how to go about doing it?