|
-
Aug 6th, 2003, 09:24 AM
#1
Thread Starter
Addicted Member
deleting a line
this may be a stupid question, but how would i delete a line from a file or (if asked to) modify the line?
-
Aug 6th, 2003, 09:59 AM
#2
Here is one way. If it's a sequential file, read the file line by line. If a line is not the line you want, immediately rewrite it to a new file. Do that until the line matches the line you want to act on. To delete the line simply do not write it to the new file, otherwise modify it and write it to the new file. At EOF, kill the old file and rename the new one to the old name.
-
Aug 6th, 2003, 10:04 AM
#3
So Unbanned
You can Split(str,VbNewline)
Which will split the file into an array, the line # being the relative index into the array.
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
|