How to compare result lpstat with hostsfile

Hi there all,

I got a long list of printers installed and a longer list of printers in my hosts file.
In the hosts file I got a even longer list of printers
in the hosts file I got the IP adress of all printers next to the printer name.

How can I get a script working to get the printers installed get from the hosts file the IP adresses of those printers so I can make a nice list with functions to enable / disable / kill que / and so on?

Yea I want to sort them out so I can find what printer is having problems.
I am working on HP UX 11iv1 Systems