I'm currently working with a database table that stores people's first and last names as a single string. This isn't a huge deal when it comes down to it, but I'd at least like to attempt to make it look nicer. Here's what my output currently looks like:
ID PersonName
-------------------
0001 JohnSmith
0002 JaneDoe
0003 MikeJones
And if possible, I'd like it to look like one of the following:
ID PersonName ID FName LName
------------------- -----------------------
0001 John Smith 0001 John Smith
0002 Jane Doe 0002 Jane Doe
0003 Mike Jones 0003 Mike Jones
For the most part, all the names in the table have the same FirstLast
format, with capital letters signifying the beginning of each name. However, I'm seeing a few issues, such as hyphenated or double last names that look like JaneDoe Smith
with a space or JohnSmith Sr
or they have an extra initial like C MichaelJones
.
Even if there's no way to account for the ones with different formatting, I'm still curious as to whether there's actually a way to split the others. All the other forum posts I've read so far are only explaining how to split strings that are comma delimited or have some sort of other special mark/symbol that's easy to pick out.