|
-
Oct 18th, 2000, 05:03 PM
#1
Thread Starter
Addicted Member
Greetings,
Here is a realy easy and stupid question 
I wonder how I can open a text file and then search it for a string and then display the info after string but only to the end of line.
like this:
FileInfo=File made by: blahblah blah..
<html>
<body background="/images/bground.gif" bgcolor="#ffffff" text="#000000" marginheight="0" topmargin="0">
...
I want to be able to display the "File made by (and so on)"
and also be able to not display the data on the next lines (the <html> and <body background="/images/bground.gif" bgcolor="#ffffff" text="#000000" marginheight="0" topmargin="0"> tags).
Thanks in advance.
-Lumin
-
Oct 18th, 2000, 05:41 PM
#2
Code:
Option Explicit
Dim FileNumber As Integer
Dim TextLine As String
Private Sub Command1_Click()
FileNumber = FreeFile()
Open "C:\Myfile.txt" For Input As FileNumber
Do While Not EOF(FileNumber)
'read line here
Line Input #FileNumber, TextLine
'look for line of text that has "FileInfo=" in it
If InStr(1, TextLine, "FileInfo=") <> 0 Then
List1.AddItem TextLine
List1.Refresh
End If
Loop
Close FileNumber
-
Oct 18th, 2000, 06:54 PM
#3
Thread Starter
Addicted Member
Thanks.
But how do I exclude the FileInfo= from the list?
I only want to show the info that is coming after it.
Anyway thanks a lot.
-Lumin
-
Oct 19th, 2000, 09:36 AM
#4
this will eliminate FileInfo=
Code:
List1.AddItem Mid$(TextLine,10)
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
|