LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   search eml file (https://www.linuxquestions.org/questions/linux-software-2/search-eml-file-4175556835/)

JJJCR 10-21-2015 10:36 PM

search eml file
 
hello guys, any ideas of a free software to search eml file contents?

What I mean is if i have a hundreds of eml files in a single folder, i just want to search for a keyword or phrase that will search the contents of the eml file and save a text result for eml files that matches the search keyword or phrase.

So there will be no need to open one by one the eml file.

Thank you.

berndbausch 10-21-2015 10:44 PM

I believe these are text files. If so, a simple grep will help.
Code:

grep <whatever option just prints the file name, not the whole line> keyword *.eml > outputfile
<whatever option just prints the file name, not the whole line> is left as an exercise to the reader.

HMW 10-22-2015 02:28 AM

Quote:

Originally Posted by berndbausch (Post 5438340)
I believe these are text files. If so, a simple grep will help.

Yes, this is true. And since I was recently forced to do just this kind of operation I can testify that it works. I actually used less to search the .eml file (an Inbox), but grep will work too of course.

Best regards,
HMW

JJJCR 10-22-2015 02:44 AM

Hi All, thanks for your reply guys.

Yes it indeed works.

For the benefit of others who will bump to this thread or will have same issue I used this command:

grep -R -H "MyKeyword" *.eml > output.txt

Thank you guys.


All times are GMT -5. The time now is 09:30 PM.