Jump to content
Sign in to follow this  
t0ddie

really dumb

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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 by this-is-me

Who else would I be?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...