I know there are my of the same questions already answered on this platform but I tried all the solutions for several hours and I cannot find my mistake. So I would appreciate any hint or help for what I am doing wrong.
Like here https://unix.stackexchange.com/questions/216511/comparing-the-first-column-of-two-files-and-printing-the-entire-row-of-the-secon and here how can i compare data in 2 files to identify common and unique data? I have two files of which I like to filter out the lines of file 2 that match column 1 in file 1. In my opinion, the proposed solution for the same questions should work but unfortunately they do not. My files are tab-separated.
file_1.txt
apple
great
see
tree
file_2.txt
apple 5.21 Noun
around 6.21 Adverb
great 2 Adjective
bee 1 Noun
see 7.43 Verb
tree 3 Noun
The output should look like:
apple 5.21 Noun
great 2 Adjective
see 7.43 Verb
tree 3 Noun
I tried comm -12,
awk (e.g awk 'NR==FNR{a[$1];next} ($1 in a)' file_1.txt file_2.txt > output.txt)
I know this might be a stupid question, I apologize in advance. However I do not seem to be able to figure it out.