Program gto_word_search

The gto_word_search search for a word in a file. It is case sensitive.

For help type:

./gto_word_search -h


In the following subsections, we explain the input and output paramters.

Input parameters

The gto_word_search program needs two streams for the computation, namely the input and output standard. The input stream is a text file.

The attribution is given according to:

Usage: ./gto_word_search [options] [[--] args]
or: ./gto_word_search [options]

Searching for a word in a text file. It is case sensitive.

-h, --help show this help message and exit

Basic options
-w, --word= Word to search in the file
< input.txt Input text file (stdin)
> output.txt Output text file (stdout)

Example: ./gto_word_search -w < input.txt > output.txt


An example of such an input file is:

No guts, no story. Chris Brady
My life is my message. Mahatma Gandhi
Screw it, let’s do it. Richard Branson
Boldness be my friend. William Shakespeare
Keep going. Be all in. Bryan Hutchinson
My life is my argument. Albert Schweitzer
Fight till the last gasp. William Shakespeare
Leave no stone unturned. Euripides


Output

The output of the gto_word_search program is a text file with the matching paragraphs and the location of the word found.

Using the input above with the word ''Shakespeare'', an output example for this is the following:

Found match in range [ 1536 : 2048 ]
Boldness be my friend. William Shakespeare

Found match in range [ 3072 : 3584 ]
Fight till the last gasp. William Shakespeare