Results 1 to 3 of 3

Thread: Text File Problem (Searched but couldn't find)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    178

    Exclamation

    I have looked back over past threads but can't seem to find a solution to my problem.

    I understand how to write into text files and how to read out of them, my problem is being able to amend a particular line.

    Is there a way to pull out a line change it and put it back into the same line.

    i.e.

    In text file have

    Line1
    Line2
    Line3
    Line4

    I want to be able to change maybe line2 to Fred so that the text file after the changes would read

    Line1
    Fred
    Line3
    Line4

    I hope you understand what it is that I am trying to do.

    Cheers for any help
    Steve

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Read the entire file into a string array.
    Change one of the strings and write them back to the file.
    I answered a simular question earlier, the difference is that that guy wanted to delete one line.
    If you read the post I'm sure you can figure it out.

    Best regards

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    178

    Thumbs up Thanks

    Thanks Joacim,
    Steve

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