I have a function which outputs a list of email addresses found in a large text file and outputs as follows:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected], [email protected]
[email protected]
[email protected], [email protected]
[email protected]
[email protected], [email protected]
I need to convert this output into a comma delimited array of email address that I can iterate over in a for loop, I also would like to remove duplicates.
I've tried a few variations of sed and not really been able to do what I want. Any tips would be brilliant.