amakrkr Posted July 6, 2010 Posted July 6, 2010 Hello all, i am stuck at jet another problem and it goes like this: I have Serial.txt file with X number of lines in it. They are constantly adding into this .txt file. Now i want to make a script that will read A line (the one i will select) and add a indicator to it like an X sign. I hope my explanation of the problem was clear. Read a line and add X to that line. So far i haven't found anything about adding Strings to a line. All function i found in help file are adding string to the end of a file. I allso tried with writing Serial.txt to serial2.txt with X to each line, that worked but i need a better solution. Code i have so far: #include <Array.au3> #include <File.au3> $File = "C:\Serials.txt" $file_temp = "C:\Serials.2txt" $file_open = FileOpen($File, 1) $file_open_temp = FileOpen($file_temp, 1) $st_line = 180 local $stevec = 1 while 1 FileReadLine($File,$stevec) if @error = -1 then ExitLoop $stevec = $stevec+1 WEnd for $i = $st_line to $stevec-1 $line = FileReadLine($File,$i) FileWriteLine($file_temp,$line & " X") Next FileClose($file_open_temp) FileClose($file_open)
amakrkr Posted July 6, 2010 Author Posted July 6, 2010 Writes text to a specific line in a file. _FileWriteToLine($sFile, $iLine, $sText [, $fOverWrite = 0]) I guess i haven't searched help good enough. Solved.
StrykeR69 Posted August 21, 2011 Posted August 21, 2011 Anyone can help me?....I want to make a script which can do the following: in a .txt file I have some text (5 lines),how can I make the script to: If the 3 line is selected,then the script copy the 4 line!?
aNewLyfe Posted August 21, 2011 Posted August 21, 2011 Anyone can help me?....I want to make a script which can do the following:in a .txt file I have some text (5 lines),how can I make the script to: If the 3 line is selected,then the script copy the 4 line!?What do you mean with selected? ~ Every Living Thing is a Code Snippet of World Application ~
JohnOne Posted August 21, 2011 Posted August 21, 2011 if you want to copy and paste some text, what do you do first? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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