Hellfire Posted April 27, 2006 Posted April 27, 2006 How can I replace the last line of the txt file to something else?Example if text file looks like this. Quote 123I want to replace the 3 with 4
Uten Posted April 27, 2006 Posted April 27, 2006 Something like: #include <File.au3> _FileWriteToLine($file, _FileCountLines($file), "4") Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
Thatsgreat2345 Posted April 27, 2006 Posted April 27, 2006 with the count lines you might want to add +1 or else you know it will write 4 next to 3 #include <File.au3> _FileWriteToLine($file, _FileCountLines($file) + 1, "4")
Uten Posted April 27, 2006 Posted April 27, 2006 thatsgreat2345 said: with the count lines you might want to add +1 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) Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
Thatsgreat2345 Posted April 27, 2006 Posted April 27, 2006 (edited) no 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 April 27, 2006 by thatsgreat2345
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