Hi guys
Trring to get screen data off a console app. Which I have successfully done and then I write that data to a file successfully.
THen one I try to read the file it doesnt seem to work. I have tried _FileCountLines and it says the there is 14 lines but trying FileReadLine it doesreturn anything . The file its Saves is ANSI. Hope ppl can help![:)]()
Here is my code:
Trring to get screen data off a console app. Which I have successfully done and then I write that data to a file successfully.
THen one I try to read the file it doesnt seem to work. I have tried _FileCountLines and it says the there is 14 lines but trying FileReadLine it doesreturn anything . The file its Saves is ANSI. Hope ppl can help
![:)](http://aut1.autoit-cdn.com/forum/public/style_emoticons/default/smile.png)
Here is my code:
[ autoit ]
#include <Constants.au3> #include <File.au3> Global $PID = Run("pdfinfo.exe IM_Rev4.pdf", @WorkingDir, @SW_MINIMIZE, $STDERR_MERGED) Global $sStdOut = "" Do $sStdOut &= StdoutRead($PID) Until @error FileDelete(@ScriptDir & "\text.txt") If Not _FileCreate("test.txt") Then MsgBox(4096, "Error", " Error Creating/Resetting log. error:" & @error) EndIf Local $file = FileOpen("test.txt", 1) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, $sStdOut) Local $line = FileReadLine($file,8) MsgBox(0, "Line read:", $line) FileClose($file)