Can you please give a more detailed question about what you have, you get, and want to have?
And also please do us a favor and edit your code to contain either a properly fenced code block or an properly indented one. It is very hard to even distinguish your code snippet from the rest of the post.
Again, please use proper markup to make code and prose distinguishable.
Anyway, it seems as if you had a complex input format which you need to parse.
Perhaps you can build something using the encoding package or its subpackages, but I rreally doubt it.
I do think you need a much more sophisticated parsing library and think of how to formulate a proper syntax for your language.
But where is your data from? Have you control over the datasource? can you make it spitting out proper JSON or some binary format? Those where much better to deserialize than what you have now…