Hello Y'all,
I am playing around with autoit and i am trying to figure out how to right a script that will:
1) read a text-file, line by line
2) put the line into a variable
This one is not important right now! -> (manipulate the variable and write it back to the file.)
3) read the next line, etc.. etc..
Can someone point me in the direction of a good example or come up with one?
Thnx!!
ps: in my case the number of lines in the text-file can vary (is unknown)
Code Fixed:
Mode 1:
#include <File.au3>
$file = "c:\yourfile.txt"
FileOpen($file, 0)
For $i = 1 to _FileCountLines($file)
$line = FileReadLine($file, $i)
msgbox(0,'','the line ' & $i & ' is ' & $line)
Next
FileClose($file)
Mode 2:
#include <file.au3>
$file = FileOpen("yourfile.txt", 0)
While 1
$line = FileReadLine($file)
If @error = -1 Then ExitLoop
MsgBox(0,'',$line)
WEnd
FileClose($file)
Mode 3:
#include <Array.au3>
#include &l