|
-
Apr 10th, 2000, 10:37 PM
#1
Thread Starter
Lively Member
I need to be able to check a flat file for key phrases How can I do this:
Exampe.
ITEM_BLOCK MASTER_MAINTENANCE /ROW=3 /COL=7 &
/FACILITY=MENU_MASTER_MAINTENANCE
I need to look for /Facility in the block above..
Thanks
Brooke
-------------------------
There is never only one right answer. That is the magic of programming.
-------------------------
-
Apr 10th, 2000, 11:41 PM
#2
Fanatic Member
fastest and easiest way is to pop the file into a richtext box control. This control has a built in "Find" function. If you need further help, send me your email address and I will send you a sample file tonight.
Chemically Formulated As:
Dr. Nitro
-
Apr 11th, 2000, 01:28 AM
#3
Fanatic Member
I sent a file call "Richie Rich.Zip". It should have what you are looking for.
See Ya
Chemically Formulated As:
Dr. Nitro
-
Apr 11th, 2000, 02:02 AM
#4
Addicted Member
If you're looking to check a file for a key phrase without actually having to display the file then you can use the InStr function. The example code below opens the C:\Autoexec.bat file and searches it for the Word "DOS".
Code:
Dim strLine As String
Dim intAnswer As Integer
Dim strFind as String
Dim strFile as String
strFind = "DOS"
strFile = "C:\autoexec.bat"
Open strFile For Input As #1
Do While Not EOF(1) ' Loop until end of file.
Line Input #1, strLine ' Read line into variable.
'Look for specific text.
intAnswer = InStr(1, strLine, strFind)
If intAnswer <> 0 Then
MsgBox "String Found"
End If
Loop
Close #1 ' Close file
Hope this helps.
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
|