Simple searching string in large text files. User can enter file and pattern he is searching. Program is using Knuth-Morris-Pratt algorithm for searching.
This program was developed for student purpouses on Faculty of Informatics and Information Technology, Slovak University of Technology
- Counting occurances
- Printing offset of occurance
- Printing line and line number
- Multi-threading
aps [-tlodh] [-p pattern] [-f file]
- -t - multithreading option (default is without)
- -l - ouputs number of line and line itself
- -d - debug output at the end
- -p - input needle (required)
- -f - input file haystack (required)
- -h - help output
git clone https://github.com/simonharvan/aps-search-string.git
cd aps-search-string/aps
gcc -framework OpenCL main.c -o <output-file>
Comparison of several string-matching programs (APS v1.0, APS v2.0, GNU Grep and BSD Grep)
Our program is not as robust as GNU grep and BSD grep but it proves to be faster than BSD grep in almost all cases and better than GNU grep in some cases. We can see that from figure 1 and 2. We also proved that multi-threading is much faster than standard one thread processing.