I have 150 words in one text file. I have another text file that contains about 100,000 lines.
How can I check each of the words belonging to the first file, regardless of whether it is in the second or not?
I was thinking about using grep , but I couldn't find out how to use it to read every word in the source text.
Is there a way to do this using awk ? Or another solution?
I tried using this shell script, but it matches almost every line:
#!/usr/bin/env sh cat words.txt | while read line; do if grep -F "$FILENAME" text.txt then echo "Se encontró $line" fi done
Another way I found is:
fgrep -w -o -f "words.txt" "text.txt"
linux shell grep awk text-manipulation
ocslegna
source share