Script Output:
Searching Text File "../samples/textfilesearch.txt" for "":
Name Sales
-----------------------
David Andersen 6420
Steven Buchanan 3245
Laura Callahan 3675
Nancy Dodsworth 2750
Frank Edwards 3840
Andrew Fuller 5000
Chris Graham 4050
Peter Hopkins 6710
Owen Ingraham 4750
Edward Jones 3450
Robert King 5290
Janet Leverling 6250
Greg Miller 5640
Beth Nelson 4345
Ian Ostrander 3965
Margaret Peacock 4685
Howard Quinn 5865
Kate Richards 4260
Fred Smith 6370
Tammy Steel 3570
Vincent Thompson 4820
Debra Underwood 3790
Linda Valentino 2965
Mark White 4500
Simon Xavier 5580
Quincy Youngs 4420
Walter Zimmerman 4980
The text searched for was found on the following lines in the file:
This sample shows you how to search a text file for a phrase.
As it is currently implemented, it displays the complete file
being searched with the search phrase highlighted and lists
the line numbers on which the search phrase was found at the bottom.
The search is case sensitive and seems to work quite quickly. I've
tested it on files with up to 10,000 lines and about 250 KB and the
results still come back pretty darn fast.
One final note... although we list the line numbers on which
the text is found, we don't actually keep track of the number
of occurances of the search phrase found in the file. If the
text is on the same line multiple times, the line number is
still listed just once.