A
Arnie
Morning all
i am reading in data from a text file as below
strFile = "C:\Folder\text.txt"
intFile = FreeFile()
Open strFile For Input As #intFile
Do While Not EOF(intFile)
Line Input #intFile, strBuffer
intEqualSign = InStr(strBuffer, "=")
Select Case strBuffer
Case "[pcconfiguration]"
StrSectionName = "pcconfiguration"
Case "[ipconfiguration]"
StrSectionName = "ipconfiguration"
End Select
If intEqualSign > 0 Then
strBefore = Left$(strBuffer, intEqualSign - 1)
strAfter = Mid$(strBuffer, intEqualSign + 1)
Select Case strBefore
Case "ComputerName"
If StrSectionName = "pcconfiguration" Then
StrMyComputerName = strAfter
Else
StrIPComputerName = strAfter
End If
Case "DomainName"
If StrSectionName = "pcconfiguration" Then
StrMyDomainName = strAfter
Else
StrIFPMDomainName = strAfter
End If
Case "IPAddress"
strIPAddress = strAfter
End Select
End If
Loop
Close #intFile
Then the code to pass it to the table required my problem is when i read
in the ip address (in the text file)
IPAdress=172.200.132.181
i can read in after the = sign but the rest i want to read in in chunks ie
ip1 172
ip2 200
ip3 132
ip4 181
i cant seem to get the right code
also if one of the ip address chunks is only 2 digits or 1 digit ie
172.20.132.200 how do i account for that, i do understand the best way is to
read in to the (.) but not sure how to execute it.
thanks in advance
Arnie
i am reading in data from a text file as below
strFile = "C:\Folder\text.txt"
intFile = FreeFile()
Open strFile For Input As #intFile
Do While Not EOF(intFile)
Line Input #intFile, strBuffer
intEqualSign = InStr(strBuffer, "=")
Select Case strBuffer
Case "[pcconfiguration]"
StrSectionName = "pcconfiguration"
Case "[ipconfiguration]"
StrSectionName = "ipconfiguration"
End Select
If intEqualSign > 0 Then
strBefore = Left$(strBuffer, intEqualSign - 1)
strAfter = Mid$(strBuffer, intEqualSign + 1)
Select Case strBefore
Case "ComputerName"
If StrSectionName = "pcconfiguration" Then
StrMyComputerName = strAfter
Else
StrIPComputerName = strAfter
End If
Case "DomainName"
If StrSectionName = "pcconfiguration" Then
StrMyDomainName = strAfter
Else
StrIFPMDomainName = strAfter
End If
Case "IPAddress"
strIPAddress = strAfter
End Select
End If
Loop
Close #intFile
Then the code to pass it to the table required my problem is when i read
in the ip address (in the text file)
IPAdress=172.200.132.181
i can read in after the = sign but the rest i want to read in in chunks ie
ip1 172
ip2 200
ip3 132
ip4 181
i cant seem to get the right code
also if one of the ip address chunks is only 2 digits or 1 digit ie
172.20.132.200 how do i account for that, i do understand the best way is to
read in to the (.) but not sure how to execute it.
thanks in advance
Arnie