|
I need to be able to have a script read a text file and capture the value of each line in the file. I know how to read a line with readline or you can even manually add another readline ($x = readline + readline) and get the first two lines of the text file. Is there a way to have the script determine how many readline's it needs to perform to get the entire contents of the file?
Below is an example of what I am working with and I have the script manually reading the first two lines of the file.
If Exist ("\\pathtofile\$month$day.txt") $msgtext = $msgtext + 'Birthdays for today are:' + chr(10) IF Open(3, "\\pathtofile\$month$day.txt") = 0 $x = ReadLine(3) + chr(10) + ReadLIne(3) Close (3) EndIf $msgtext = $msgtext + chr(10) + $x + chr(10) + chr(10) EndIf
I then use a messagebox to display the value of $msgtext.
Can someone help?
Thanks
|