Results 1 to 3 of 3

Thread: Replace line of text in file...

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 1999
    Posts
    51

    Post

    I have a file and I need to search for a string of text and replace that line with another line of text. What's the best way to do this?

    Thanks

  2. #2
    Guest

    Post

    'with the replace function; try that:

    MyString = "abcdefghij"
    Replace(MyString,"def","DEF")

    'MyString will be now "abcDEFghij"

    'tell me if it helps

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 1999
    Posts
    51

    Post

    I need to be able to replace the whole line in the file. I think with 'replace' I would have to read the file into a variable and write it back to the file. Is there an easier way to do this? If not, I can just read the file into a variable and do it.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width