Text filters are command-line programs that take text as input, transform it then output the results. An example of a common built in text filter is sort which when passed newline separated text will sort each line:
printf 'b\nc\na' | sort
You can write your own text filter scripts …