Amilo Posted November 23, 2014 Share Posted November 23, 2014 başlıktada belirttiğim gibi arkadaşlar bir bir txt ye yazılan en son satırı yada satırları okutma istiyorum ve yardımlarınızı bekliyorum Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted November 23, 2014 Share Posted November 23, 2014 En son satır ; #include <FileConstants.au3> $Open = FileOpen(@ScriptDir & "\deneme.txt", $FO_READ) $Read = FileReadToArray($Open) $SonSatir = FileReadLine($Open, UBound($Read)) Quote Link to comment Share on other sites More sharing options...
Amilo Posted November 23, 2014 Author Share Posted November 23, 2014 @DivaneTR öncelikle cevabın için çok teşekkür ederim ancak yanlıs anlamazsanız bir maruzatım daha var örnek vermek gerekirse ; #include <FileConstants.au3> $Open = FileOpen("deneme.txt", $FO_READ) $Read = FileReadToArray($Open) $SonSatir = FileReadLine($Open, UBound($Read)) while 1 MsgBox(64,"",$SonSatir) Sleep(5000) WEnd böyle bir döngü olması gerekiyor. ancak hep aynı son mesaj karşıma cıkıyor . acaba şu şekil yapabilirmiyiz. Mesela program en son mesajı okudu onun altına yenisi gelene kadar okuma yapmayacak bu arada tekrar teşekkür ederim cevap yazdığın için Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted November 23, 2014 Share Posted November 23, 2014 AdlibRegister(_Oku, 5000) ;5 saniyede bir tekrarlar Func _Oku() $Open = FileOpen(@ScriptDir & "\deneme.txt", 0) $Read = FileReadToArray($Open) $SonSatir = FileReadLine($Open, UBound($Read)) MsgBox(64,"",$SonSatir) EndFunc ;==>_Oku While 1 WEnd Quote Link to comment Share on other sites More sharing options...
asmazh Posted November 26, 2014 Share Posted November 26, 2014 Local $fileFullPath = @DesktopDir & "\abc.txt", $fileLastEndLine While True $fileTotalLine = StringSplit(FileRead($fileFullPath), @CR)[0] $fileEndLine = FileReadLine($fileFullPath, $fileTotalLine) If $fileEndLine <> $fileLastEndLine Then _ ConsoleWrite(StringFormat("EndLine.Updated: " & $fileEndLine & "\n")) $fileLastEndLine = $fileEndLine Sleep(500) ; // Optional. WEnd İstediğin şey tam olarak bu. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.