In this recipe, we demonstrate how to search for certain words in a text file. You can find the code in the
search.dart script in the project
searching_file. As an example text file, we use
The program is launched from the command-line in the
bin folder (or in Dart Editor with a Managed Launch with Script argum
-n search1 search2taoprog.txt) as shown in the following screenshot:
h.dart -n search1 search2 taoprog.txt , where
search2 are words to be searched for, there can be one or more search words. For example, let's search for mysterious and machine, in which case, the ...