|
-
Mar 20th, 2001, 05:33 PM
#1
Thread Starter
Member
I am trying to open a text file and read through each line. If the line begins with the specified string, I want to change it to read something different. I am able to open it and read each line okay, but I can't figure out how to do the updating. Can somebody please show me how?
Thank you.
-
Mar 20th, 2001, 05:44 PM
#2
Frenzied Member
One way would be something like this pseudo-code
1. Create a NewTextFile
2. assign a Variable = ReadLineFromOldTextFile
3. If Left$(Variable, Len)SearchString)) = SearchString Then Variable = ChangedVariable
4. Write Variable to NewTextFile
5. When done, close and delete original text file
6. close new text file and rename it to original text file's name.
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
|