Jump to content

Replacing The Last Line Of A Txt File


Recommended Posts

with the count lines you might want to add +1 :think: or else you know it will write 4 next to 3

#include <File.au3>
_FileWriteToLine($file, _FileCountLines($file) + 1, "4")
Except we have to add the 1 at the end of the argument list to replace 3 with 4 :(

#include <File.au3>
_FileWriteToLine($file, _FileCountLines($file) , "4",1)
Link to comment
Share on other sites

no :think: if you do a countlines its going to count 3 lines correct? but if he wants to add it on the last line (line 4) when it does the countilnes its goign to count 3. THus when he does the write to the line its going to write it on line 3 not line 4

edit: read the topic wrong thoguht he wanted to write to last line :(

Edited by thatsgreat2345
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...