Programming Perl is a good reference. They call it the bible, I call it a function reference. I typically stick to Learning Perl as it does a lot more in the way of explaining things. CPAN contains all the modules and some documentation, but definitely visit perldoc.perl.org as it is filled with tons of information.
As for your issue, I am now even more confused. The output you are looking for:
BOB####### |---tab deliminated--| Tom_LK
looks to contain data from two seperate lines in your output. Is this correct? If so, we need to be able to determine what is a machine name and what is a user name. Can you describe the file further?
Regards,
Jeff
The output is on 2 seperate lines.
BOB#### is the computer name
TOM_LK is the user name
Basically nbtstat checks the NetBIOS information on windows machine. if a user is logged on to that machine it prints that out as well. Someone took that nbtstat information for a number of machines and redirected the output to a text file. I am not sure if they realized all the extra information they will get along with the computer and and user name; there are 2 other wrinkles. Some of the machines they ran this command against did not have a user name associated with it (basically that means that the line with TOM_LK . is not there) and there some machines the command could not find, so it printed out the phrase "host not found." Here is an idea of how all of this looks on the text file:
C:\WINDOWS\system32>nbtstat -a BOB#######
Local Area Connection:
Node IpAddress: [] Scope Id: []
NetBIOS Remote Machine Name Table
Name Type Status
---------------------------------------------
BOB####### <00> UNIQUE Registered
DL <00> GROUP Registered
BOB####### <03> UNIQUE Registered
BOB####### <20> UNIQUE Registered
TOM_LK <03> UNIQUE Registered
MAC Address =
C:\WINDOWS\system32>nbtstat -a MOE#######
Local Area Connection:
Node IpAddress: [] Scope Id: []
NetBIOS Remote Machine Name Table
Name Type Status
---------------------------------------------
MOE####### <00> UNIQUE Registered
DL <00> GROUP Registered
MOE####### <20> UNIQUE Registered
MOE####### <03> UNIQUE Registered
MAC Address =
C:\WINDOWS\system32>nbtstat -a BILL#######
Local Area Connection:
Node IpAddress: [] Scope Id: []
Host not found.
for the first output the script needs to printout a line like this
BOB####### TOM_LK
for the other 2 outputs the scripts needs to print
MOE####### No user found
BILL####### No user found
I hope that helps.