xdp22 Posted October 15, 2011 Share Posted October 15, 2011 Hello, i need to do function, what return biggest number from file. In example i got file test.txt 1 8 101 9 11 So in this file biggest number is 101. I tried do it : #include <file.au3> $e = _FileCountLines("totalne_testy1.txt") $i=0 For $i = 0 To $e Local $last,$last1 If FileReadline("totalne_testy1.txt", $i) > $last Then $last = FileReadline("totalne_testy1.txt", $i) EndIf Next MsgBox( 0, "", $last) But doesn't work :| Link to comment Share on other sites More sharing options...
UEZ Posted October 15, 2011 Share Posted October 15, 2011 Try this: #include <Array.au3> $aNumber = StringSplit(StringStripCR(FileRead("totalne_testy1.txt")), @LF) For $i = 0 To UBound($aNumber) - 1 $aNumber[$i] = Number($aNumber[$i]) Next _ArraySort($aNumber, 1) MsgBox(0, "Biggest Number", "Biggest number: " & $aNumber[0]) Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
xdp22 Posted October 15, 2011 Author Share Posted October 15, 2011 My god it's working great, thanks Link to comment Share on other sites More sharing options...
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