I have moved your post off of the SOLVED thread you had tacked it onto - in the future, please create your own thread for your question, rather than attaching it on someone else's thread.
Also, please see this link
for a quick intro to "code tags" - something you should use when posting pieces of code, or chunks of data files or terminal output, to retain the formatting of the original text.
Finally, here's a link
to a recent thread on a similar subject, where there is not yet a solution, but some hints and suggestions have been given for how to proceed with something like this.
Cheers & best regards.