2

This question already has an answer here:

I have two files: one which is the dictionary, and the other one corresponds to the list of words that appear in a transcription. I need to output the words out of vocabulary words. This is:

dict.txt
you 
she
apple
banana
strawberry
eat

transcript.txt
you
strawberry
and 
banana
<silence>
for 
breakfast

So, my desired output would look like this:

and
for
breakfast
<silence>

Is there any command output such words that are not found in the dictionary? thanks in advance!

marked as duplicate by don_crissti, Jesse_b, Jeff Schaller, αғsнιη, Romeo Ninov May 12 '18 at 14:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3
grep -vf dict.txt transcript.txt
    and
    <silence>
    for
    breakfast
  • When I run that command I got "killed" :/ – little_mice May 12 '18 at 12:22
  • @little_mice: Where is killed coming from? Is it an error or a word in one of your files? – Jesse_b May 12 '18 at 12:35
  • When I run that command in the terminal it outputs "killed" in the same terminal. And the file where the output should be redirect is empty – little_mice May 12 '18 at 13:10
  • 1
    This command must be run in the directory containing dict.txt and transcript.txt (or specify the full path to those files. Also this command as is will not produce an output file (because you have not asked for one), it will send the output to stdout. – Jesse_b May 12 '18 at 13:19
  • it finally worked! the problem was that it wasn't run in the directory was @Jesse_b said. Thanks! – little_mice May 12 '18 at 15:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.