well, you are looking for a piece of software solving your problem.
we found that this is (probably) not written, yet.
so, if you need it, someone has to write it.
there are two ways:
1. you can ask someone to write it for you.
(like beckerist, who is a experienced programmer, knows many languages, and has obviously much time

)
2. you have to write it by yourself.
I showed you some possible basic approaches.
2.1 you have the required knowledge: write it and have fun.
2.2 you are missing some knowledge: this is the perfect time to learn it! ask google or buy a book. it isn't that difficult.
or you find out, that your problem is maybe not so importent, so you can forget about it.