Hi people,

long time no log-in. Any ideas on this?:

I have a long list of e-mail addresses which I want to use for a mass-subscription to a Mailman mailing list. Don't worry, I'm not spamming or anything, just streamlining a previously unwieldy manual mailing-list, for an NGO in Peru.

The curious problem is that all these e-mail addresses are arranged on one line in a text file, having been prepared in Microsoft Word (shudder!). The addresses are each separated from the next by one comma and one space. Hoewever, Mailman requires one address per line, each line separated by a "hard return".

I know only enough sed to do this:
Code:
sed 's/, /\n/'g mailing-list.txt
Which basically does the job, replacing each occurrence of ", " with "\n" (a hard return).

BUT...

some of the addresses are of the form:

Code:
Smith, John D <blah@blah.org>
Is there a way to NOT remove the comma when it's NOT separating two e-mail addresses, merely separating last names from first names?

Yours hopefully,

Andrew.