|
-
Jun 19th, 2000, 07:10 AM
#1
Thread Starter
Junior Member
hi,
Is it possible to get the line number of a certain string in a text file, and you would do it. Also is it possible to delete a certain line from a text file, how would you code it?
Thanks for Reading this!
-
Jun 19th, 2000, 08:01 AM
#2
transcendental analytic
You could open in input mode and use lineinput method to get all lines and have a counter counting them. Also you could open in binary and get a varlen string and split it into an array of lines.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 19th, 2000, 08:23 AM
#3
Code:
Dim Count As Long
Dim MyVar As String
Count = 1
Do Until EOF(FileNumber) = False
Text2.Text = Text2.Text & Count ' show the number
Line Input #FileNumber, MyVar ' put the contents into MyVar
Text1.Text = Text1.Text & vbNewLine & MyVar ' make sure multiline is true
Count = Count + 1 ' update count
Loop
this doesnt include the open and close statements..
I havent tested this code yet, so let me know if it screws up.
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
|