Jump to content
Sign in to follow this  

Adding text to a textfile

Recommended Posts

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!

Share this post

Link to post
Share on other sites

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.")

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


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...