|
-
Dec 5th, 2000, 08:08 AM
#1
Thread Starter
New Member
I need to search a random access file's records for a specific string. Any ideas?
-
Dec 5th, 2000, 09:14 AM
#2
Lively Member
Why Not?
Why don't you just open the file and parse it. Comparing each line to string you are searching for i.e
Const SearchString = "Blah Blah Blah"
Dim FileNumber As Integer
Dim FileName As String
Dim Data As String
FileNumber = FreeFile
FileName = "C:\filename.txt"
Open FileName For Input Access Read As #FileNumber
Do Until EOF(FileNumber)
Line Input #FileNumber, Data
IF Data = SearchString Then msgbox "Hooray"
Loop
Close #FileNumber
Hope this helps
Ian Frawley
Software Engineer
E-mail [email protected]
BEING IN THERAPY
And yet, having therapy is very much like making love to a beautiful woman. You... get on the couch, string 'em along with some half-lies and evasions, probe some deep dark holes, and then hand over all your money.
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
|