The reason I asked the logic behind workstation and printer names is that if you have a decent schema the job becomes far simpler.

If your workstation name comprises a letter identifying it as a workstaion, followed by a three letter site mnemonic followed by a room number followed by a wokstation number the job is almost done for you.

For example, NWGTC20103
Means:
NW NT Workstaion
GTC Gleed Technical College
201 Room 201
03 workstation number three

If you've used a similar scheme for your printers: PRGTC20101
PR Printer
GTC Gleed Technical College
201 Room 201
01 First printer

As you can surmise, all you need to do is substring out the location and room number from the workstation, prepend "PR" then append "01" and "02" to get the names of the printer queues.