I have multiple files in a folder and each of them have one email message. Each message has a header in the format
Subject: formatting fonts
To: help@abc.com
From: sender name
message body
I want to get all the unique sender names from all the messages (there is only 1 message per file) . How can I do that?
Assuming there can’t be random headers in the middle of the messages, then this should do the trick:
If there may be other misleading “From:” lines in the middle of the messages, then you just need to make sure you are only getting the first matching line from each message, like so:
Obviously you can replace the * in either command with a different glob or list of file names.