Given a Full Name, return the First Name and Last Name.

Given the full name '%full_name%', which may have the first and last name in either order, please:

1. Extract the first name and last name, assuming the most likely common order for first and last names. Prioritize recognizing common first names and last names where possible.
2. If there are more than two parts to the name (e.g., a middle name or a prefix like 'Dr.'), consider only the first and last name.

Example 1
Full Name "John Michael Doe" must return:
First Name: John
Last Name: Doe

Example 2
Full Name "Doe John" must return:
First Name: John
Last Name: Doe

How to use this prompt on a CSV file?

Datablist allows you to take an entire CSV file and run prompts directly on every line. Whether you're cleaning data, generating summaries, or transforming text, this method saves hours.

The great news is that the prompt you need is already available in Datablist under the "Templates" section. No need to start from scratch! Simply select the template that fits your task, and it’s ready to run on every line of your CSV. This makes it even easier to transform your data with just a few clicks.

Import your CSV file in Datablist. Then select "Enrich" from the header.

Select Enrich
Select Enrich

Then select the template: Parse Full Name into First Name and Last Name

Select Enrich
Select Template

Replace the variables from the prompt with your collection's properties using {{

Use your data
Define variables using your collection's properties