I have around 1,500 Windows folders that contain 1,000s of emails in .EML file format.
I need a script that can read each of these .eml files and if within the first 20 lines of text the regular expression "From: "????" <????@domain.com>" cannot be found then delete the file. The ??? marks represent varied values.
The outcome of the script should leave me with just the emails (.eml files) that were sent from "domain.com".
I appreciate the script will take a very long time to process, however it will complete the this task a lot faster than me manually doing it!
Many thanks in advance!