t0ddie Posted January 18, 2005 Share Posted January 18, 2005 im too drunk to think FileWrite($file, "{bs}") i want to erase one character from the end of a file, yet this displays {bs} in the file instead im sure if i read the help file, yadda yadda yadda.. this is much more annoying though, and i live for that. (just kidding) anyways... whats the quick solution. my beer is getting warm thanks a bazigillioner drunken T0ddie (not sober) la la laaaaa ahahahaaaaa~!!!! im such a retard Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
this-is-me Posted January 18, 2005 Share Posted January 18, 2005 (edited) You will have to read the whole file, erase the last character with StringLeft() and StringLen() then rewrite the file. You can also simplify the situation with filereadline and filewriteline I think. Edited January 18, 2005 by this-is-me Who else would I be? Link to comment Share on other sites More sharing options...
t0ddie Posted January 19, 2005 Author Share Posted January 19, 2005 ok, sounds like alot of work for something simple. too bad you cant have the script read the file from the end first. i'll figure out some huge routine, and incorporate it into my slop. Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
scriptkitty Posted January 19, 2005 Share Posted January 19, 2005 ok, just thinking from memory: filetrim("test1.txt",1); useage file, how many characters to delete func filetrim($_file,$num) $fileread=Fileread($_file,Filegetsize($_file)) $fileread=StringTrimRight($fileread,$num) filedelete($_file) filewrite($_file,$fileread) EndFunc AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now