[RESOLVED] how to match with value in text file
i have data in two text box, then i want to match it with data in text file. after match, i want to take value in column 3.
textbox1= 2.9167 will refer to column 1
textbox2 = 101.7745 will refer to column 2
example data in text file:
column1 column 2 column 3
2.9100 101.7705;60
2.9103 101.7767;40
2.9110 101.7756;20
2.9167 101.7744;60
2.9167 101.7745;60
2.9167 101.7746;50
2.9167 101.7747;80
after match value in text box with value in text file, i need value in column 3(e.g 60, in red color). how to write the code?can anyone help me...
thanks..
Re: how to match with value in text file
Try this code!
Code:
Open "F:\1.txt" For Input As #1
While (Not EOF(1))
Line Input #1, strLine
strArr = Split(strLine, ";")
strTextValue = Split(strArr(0), " ")
If Trim(strTextValue(0)) = Trim(Text1.Text) And Trim(strTextValue(1)) = Trim(Text2.Text) Then
Text3.Text = strArr(1) '--3rd column value
End If
Wend
Close #1
Re: how to match with value in text file