Extract text from a textfile
Posted: 17 Oct 2009 05:13
Hi,
I'm trying to extract a piece of text from a line, but I'm not getting there.
So what I'd like to do is to get the ip address out of the line of text.
So could anyone tell me how I could fix this?
Thanks
I'm trying to extract a piece of text from a line, but I'm not getting there.
Code: Select all
Minimum Host : 192.168.1.1 11000000.10101000.00000001.00000001
Minimum Host : 192.168.1.1 11000000.10101000.00000001.00000001
Minimum Host : 192.168.1.9 11000000.10101000.00000001.00001001
So what I'd like to do is to get the ip address out of the line of text.
Code: Select all
set fso = wscript.createobject("Scripting.filesystemobject")
Set fileStream = fso.OpenTextFile("ip.txt", 1)
dim arrLijnen()
redim arrLijnen(1)
dim teller
do
templine = filestream.readline
arrLijn = split(templine,":")
arrLijnen(teller) = arrLijn
teller = teller + 1
redim preserve arrLijnen(teller)
loop until filestream.atendofstream = true
filestream.close
So could anyone tell me how I could fix this?
Thanks