I have managed to extract name and email addresses columns from from a CSV.
The email field is the only field that is always there. The name field can be blank, just a first name and sometimes a first name and last name. Like this:
Name, Email
Fred, [email protected]
Wilma Flinstone, wima@flintstones
,[email protected]
What I would like to do is create a new CSV from the above that splits the name into first and last if possible. So the above would look like this:
First Name, Last Name, Email
Fred, ,[email protected]
Wilma, Flinstone, wima@flintstones
,,[email protected]
How could I do this in Perl?
Pebbles Flintstone Rubble