Computer Hope

Software => BSD, Linux, and Unix => Topic started by: karlosss on November 26, 2016, 07:23:43 AM

Title: Linux fgrep how to extract "only_words_in_my_language" from a big "MIXED_WORDS"
Post by: karlosss on November 26, 2016, 07:23:43 AM
Hi everyone

I want something to extract "only_words_in_my_language" from a big "MIXED_WORDS" file and for that i used the syntax bellow but with poor results:

Code: [Select]
fgrep -w -f "only_words_in_my_language.txt" "MIXED_WORDS_from_all_over_the_world" > extracted_word_of_my_country_only.txt
That's why i'm thinking mmmm.. to ''MATCH'' the entire WORD,for better results
For example this is a WORD in my language:


Maimuta - 7 letters lenght,if i match the entire word the results could be:

Code: [Select]
maimuta@123
maimuta2016!
Maimuta01!
maimuta@123456

if i match 6 letter the res. could be:

Code: [Select]
maimut
maimutoi1
Maimutareala01!

So my question is how to do that??how to match the entire word or or all but not the last one?
A regex or something for linux please
thank you
Godluck to all!!