Login | |
|
 |
RE: Pull information from a file based on search criteria - 12/4/2006 5:36:18 PM
|
|
 |
|
| |
kirrilian
Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
|
load your IP addresses into an array (you already have a loop for that) and use a for each to search thru the array of IP addresses on each readline since you are parsing a csv file I would use the builtin split() function to parse the line out after you have a match create another array for all your IPs that dont match are you having a specific problem with your script? everything looks to be okay with it to me. sorry if im not making much sense, its waaaay past my bedtime
_____________________________
Have you searched here ? VBScript Fundamentals My Site
|
|
| |
|
|
|
 |
RE: Pull information from a file based on search criteria - 12/5/2006 2:49:59 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
Could you show an example of dhcpout.txt? You can of course change the information for security reasons, I would just like to see the format.
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Pull information from a file based on search criteria - 12/5/2006 3:37:08 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
"...the text file is a CSV file pulled from the DHCP Server." The csv file is the one I need to see. That is the one you need to parse right?
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Pull information from a file based on search criteria - 12/5/2006 6:14:00 AM
|
|
 |
|
| |
aburt
Posts: 104
Score: 0
Joined: 12/4/2006
Status: offline
|
Ok then lets say the data is like this: IP Address = 100.10.12.11,SubnetMask = 255.255.254.0,Client Hardware Address = 00-00-00-00-00-00,Name = MachineNameA.org.company.com,Comment = (null), Type = DHCP, Expires = 12/05/2006 08:07:58, Owner Host IP Address = 100.10.12.11, Owner Host NetBios Name = Server, Owner Host Name = (null). IP Address = 100.10.12.12,SubnetMask = 255.255.254.0,Client Hardware Address = 00-00-00-00-00-02,Name = MachineNameB.org.company.com,Comment = (null), Type = DHCP, Expires = 12/05/2006 08:07:58, Owner Host IP Address = 100.10.12.11, Owner Host NetBios Name = Server, Owner Host Name = (null).
|
|
| |
|
|
|
 |
RE: Pull information from a file based on search criteria - 12/5/2006 8:05:04 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
If Not dicClients.Exists("100.10.9." & i) Then Set dicTemp = CreateObject("Scripting.Dictionary") dicTemp.Add "IP Address", "100.10.9." & i dicTemp.Add "Name", "Something.org.whatever.com" dicClients.Add dicTemp("IP Address"), dicTemp End If this part would assign it to whatever you want.
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Pull information from a file based on search criteria - 12/5/2006 8:25:55 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
Well, for one thing, the loop that you posted (and that I used for a guide) loops though ip address 10.100.9.0 to 10.100.9.255. In the text snippet that you provided, none of those IP addresses are present. So, if none are present, they will all be set to whatever you have set up as the default.
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
|
|