Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

trouble reading file

$
0
0
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:

[ 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)

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>