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

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:


if i match 6 letter the res. could be:


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

i tried this but,dnes't work:

fgrep -iowf "my_lang_dict.txt" "mixed_words" > my_lang_unique-words.txt

My lang.dict.txt(900kb) and mixed_file(64 mb),grep says: Memory Exhausted

Imagine ur bulgarian,russian and you want to extract ''only'' the words that are in the language of your country from a big mixed words all over the wordl text file.How u would do that?u need a ''ur country'' dictionary right?and then compare all the words from ur country dictionary with the mixed one and i think best results are.... when u match the entire word!


As the error message tells you, you don't have enough memory. The system is building up a regular expression to match all the words in your 900KB file. The size of the mixed_word file doesn't matter. The error message might be misleading in that it might be that it really means regular expression too complicated.

You should be able to break your lang.dict.txt into smaller chunks. You can use the unix command split to do this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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