archies Posted November 13, 2007 Posted November 13, 2007 (edited) Hey guys, All I am trying to do is add a small piece of text to the end of each line in a .txt file. For example: orginal.txt file: This is a sentence blah blah blah This is a sentence blah blah blah This is a sentence blah blah blah This is a sentence blah blah blah This is a sentence blah blah blah then I want to add the text "[END]" after each line so the new .txt file would look like this: This is a sentence blah blah blah[END] This is a sentence blah blah blah[END] This is a sentence blah blah blah[END] This is a sentence blah blah blah[END] This is a sentence blah blah blah[END] Is this possible with autoit? Thanks guys! Edited November 13, 2007 by archies
Achilles Posted November 13, 2007 Posted November 13, 2007 Well, like I said in the other topic you have, try looking at _FileWriteToLine. However, if you're just appending text you could use FileWriteLine (not _FileWriteLine, there is a difference). My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
rasim Posted November 13, 2007 Posted November 13, 2007 #include <File.au3> Dim $StrArray _FileReadToArray("c:\test.txt", $StrArray) For $i = 1 To $StrArray[0] $StrArray[$i] &= "[END]" Next _FileWriteFromArray("c:\result.txt", $StrArray, 1)
archies Posted November 13, 2007 Author Posted November 13, 2007 (edited) rasim!! You are a genius! It works beautifully and does exactly what I need! I can't believe how powerful this autoit thing is. But I guess the power is really in the hands of the people who know how to use it! Thanks for your help man you saved me a ton of work Edited November 13, 2007 by archies
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