I am working with a csv file of several fields of data, but I only need help with re-formatting a name field. The name field is a variable-length, slash-separated (/) data that can be in any of these various formats:
George Washington/GOV/VA/US John Adams/GOV/MA/US John Q Adams/GOV/MA/US John Q Adams Jr/GOV/MA/US John Q Adams JR/NonEmployee/GOV/MA/US Thomas Jefferson/GOV/VA/US
As you can see, most of these lines have a name followed by three slash-separated bits of data, but some will have more. All I need from this is the name part of the data. Everything from the first "/", including the slash character isn't needed.
With the name, I need to re-format into two fields for last name, and first name, to put into a csv file, so that the above data needs to come out as:
Washington, George Adams, John Adams, John Q Adams Jr, John Q etc.
I've considered using some kind of split() statement to separate the name field by the slashes, but I don't know how to do that? Also, how to reverse the names to display last name before first name?
Thanks!
In reply to How to re-format a name field by pbassnote
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |