Implement the filters: longLines, linesWith. The filters have similar structure. They accept one parameter from the command line (length limit or a string of characters) and then read, one by one, all lines from the standard input. Each line is tested. The only difference consists in different functions used to reject or accept lines. Functions strlen and strstr could simplify the implementation of the respective filters.
Use the pipeline processing to:
• Print out a sorted list of all words in the file test.txt that are longer then 10 characters.
• Print out a sorted in reverse order all words the file test.txt that are longer that contain the string xxxx.
• Count how many times the word xxx is in the file text.txt.
#include <stdio.h>
#include <ctype.h>
int main(int argc, char* argv[])
{
int c;
int prevC=0;
while ((c=getchar())!=EOF)
{
if (isalpha(c))
putchar(c);
else
if (isalpha(prevC))
putchar('\n');
prevC=c;
}