I regularly need to process large lists of user data for our marketing emails. I get a lot of CSVs with full name and email address and need to split these full names into separate first name and last name values. for example:
John Smith,jsmith@gmail.com
Jane E Smith,jane-smith@example.com
Jeff B. SMith,jeff_b@demo.com
Joel K smith,joelK@demo.org
Mary Jane Smith,mjs@demo.co.uk
In all of these cases, I want Smith
to go in the last name column and everything else into the first name column.
Basically, I'd like to look for the last space before the first comma and replace that last space with a comma. But, I'm lost on how to do this, so any suggestions would be greatly appreciated. Also, I'm using BBEdit
to process the text file.