|
-
October 16th, 2001, 11:48 AM
#1
searching a text file
Does anyone know how to programmatically open an existing text file. Then search through a comma delimited file(like the portion below) for a string, '475'.
16,301,13981439,Z,IA0010,012040/
16,301,4756071,Z,IA00045,000000/
16,475,72363175,Z,IA00025,012040/
16,475,42736600,Z,IA00025,012050/
Thank you
No L c
VB Developer
-
October 16th, 2001, 12:31 PM
#2
Re: searching a text file
Dim sLine As String
Dim aryInput() As String
Dim i As Integer
Open "c:\file.txt" For Input As #1 'to read from
Do While Not EOF(1)
Line Input #1, sLine
aryInput = Split(sLine,",")
For i = LBound(aryInput) To UBound(aryInput)
if aryInput(i) = '475' then
...do something
end if
Next
Loop
Close #1
Iouri Boutchkine
[email protected]
-
October 16th, 2001, 02:29 PM
#3
Re: searching a text file
thank you for the response
No L c
VB Developer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|