Friday, February 13, 2009

[THIN] OT: advanced search & extract from a text file

here's the scenario - I need to run HP Download Manager and update our jetdirects. Unfortunately, we block broadcasts at the routers. I can export the printers reg key from our print server and do a search on "portname", but the actual portname is 2 lines down from the line containing the actual port name. So you have something like this:

Name:  portname
Type:    REG_MULTI_SZ
Data:    IP_10.1.1.10

Now obviously I can search on "IP_" and get most of them, but that'll leave out a number of printers where we're using the jetdirect hostname as the portname (Greg will never believe that I convinced people to go this route and get away from static IPs and DHCP reservations. :D )

Anyone have any ideas? In my younger, semi-smarter days I was able to whip up small codes in BASIC or FORTRAN that could do what I want, but I've long since forgotten how to do stuff like that.


No comments: