View Single Post
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 10-22-2006 , 15:25   Re: Using Files to write data/values(old and new file commands)
Reply With Quote #2

Nice tutorial.

Anyway, I have a question for you.

I'm writing a plugin that tries to update some lines in files with new text... I was trying to just use appending to the file, but it seems like whenever append is used, it adds a new line... let me try to explain what I'm trying to do a bit better:

There is a string (containing spaces) of an unknown length saved to a text file. I would like to allow the user to type in a phrase (not of a limited length), such as "likes blue cars." so that I can add it to the unknown string on the unknown string's line.

So it would read in the unknown, which might be "Bad Bud ", add in the new string "likes blue cars." with format, so the final string would read "Bad Bud likes blue cars.", and save it back to its original line in the text file (overwriting "Bad Bud " with "Bad Bud likes blue cars.").

How can I do this? I've tried, but it keeps adding weird characters to the end of the added string. They look like this: o>‘|b>‘|

Any suggestions? Sorry for crappily explaining my problem.
Bad_Bud is offline