Heretic Posted July 6, 2014 Share Posted July 6, 2014 (edited) Hello all, I was wondering if anybody around here could help me with a little problem. Is there is a method I can use to append a string of text to the end of a line inside a text file? I've been browsing all over the forums here and there are lots of answers that are really close, but I have not found a solution that has actually worked for me. A few I didn't even really understand but tried anyway, with no luck. The function: FileWriteLine($LOG, "FText") just adds a whole new line at the bottom, while the function: _FileWriteToLine($LOG, 1, "FText", 0) adds the the letters "FText" to the beginning of the first line in the log file. I am sure the answer is already burried somewhere in this forum, but I can't seem to find it. Is there any way I can add this text to the end of the first line, instead of the beginning? ps. Thank you for your time. Edited July 6, 2014 by Heretic Link to comment Share on other sites More sharing options...
Solution iamtheky Posted July 6, 2014 Solution Share Posted July 6, 2014 (edited) How about $line = FileReadLine($LOG, 1) first, then you _FileWriteToLine($LOG, 1, $line & "FText", 1). Edited July 6, 2014 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Heretic Posted July 6, 2014 Author Share Posted July 6, 2014 How about $line = FileReadLine($LOG, 1) first, then you _FileWriteToLine($LOG, 1, $line & "FText", 1). Yep, That'll do it. Thank-you kindly, sir. Link to comment Share on other sites More sharing options...
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