Jump to content

Recommended Posts

Posted

Like the title say, i want to add text to a textfile(txt), the textfile will already contain text so its important not to overwrite it, just add.

Anyone have any idea how to do this ?

Thanks in advance!

Posted

I'm new to scripting with AutoIt but I looked a bit in the help file and found this.

Directly from Help File, all credit to AutoIT team.

$file = FileOpen("test.txt", 1)

; Check if file opened for writing OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileWriteLine($file, "Line1")
FileWriteLine($file, "Line2" & @CRLF)
FileWriteLine($file, "Line3")

FileClose($file)

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
×
×
  • Create New...