How do I convert a full name to firstname lastname

I need to parse some text that I have in a DB. I have over
5000 records to output, so I am hoping something will be
effiecient. However, it is a one time process, so it is not that
big of a deal.
I have a field 'fullName'. It contains a users full name (as
the name implies). I need to output this so that the 'firstName' is
in one field and the 'lastName' is in another field. The entries
range from 'Jim Smith' to 'John C. Dvorak Jr.' (not really John,
but I wanted to keep this interesting).
In the case of John, I need the first name and Middle initial
to end up in the 'firstName' field and everything else in the last
name field.
I tried to loop over using a space as the delimeter, but that
just sepeates everything into parts. I need the middle initial to
hang with the first name and anything trailing the last name to
remain there.
Any clever thoughts? Help is much appreciated.

ok, try this:
<cfoutput query="getUsers">
<cfset numelements = listlen(getUsers.fullName, "
")><!--- this will give you number of elements in fullName
--->
<cfif numelements is 2>
<cfset firstname = listfirst(getUsers.fullName, "
")><!--- assign first element to firstname --->
<cfset lastname = listlast(getUsers.fullName, "
")><!--- assign last (2nd) element to lastname --->
<cfelseif numelements gte 3><!--- 3 or more elements
in fullName --->
<cfset firstname = listgetat(getUsers.fullName, 1, " ")
& " " & listgetat(getUsers.fullName, 2, " ")><!---
assign elements 1 and 2 to firstname --->
<cfset lastname = right(getUsers.fullName,
len(getUsers.fullName) - len(firstname) - 1)><!--- assign the
rest of the string (less the space separating 2nd and 3rd elements
[the -1]) to lastname --->
<cfelse><!--- 0 or 1 elements in fullName --->
<cfset firstname = getUsers.fullName>
<cfset lastname = ''>
</cfif>
</cfoutput>

Similar Messages

  • How do I convert visa resource name into string?

    Could please anybody help? I have an ergent need. How do I convert visa resource name into string?
    Thank you in advance.

    Most times you do not need to convert it. Just wire it stright into what ever string input.
    See "Format Into Srting" or "Type Cast" functions
    Omar

  • HT201342 How do I change the 'Full Name' on my iCloud Mail (and on my Apple ID as I think this is where it gets the name)? Thanks

    How do I change the 'Full Name' on my iCloud Mail (and on my Apple ID as I think this is where it is getting my Full Name? Thanks

    To change it on and iOS device, go to Settings>Mail,Contacts,Calendars...tap your iCloud email account, tap you iCloud account at the top, tap Mail at the bottom, then enter the name you want to use in the Name field at the top.
    To change the From name on your Mac Mail, go to icloud.com, sign into your account, open Mail, click the gear shaped icon on the top right and choose Preferences, go to the Accounts tab and enter the name you want to use in the Full Name field and click Done.  Then quit Mail on your Mac and re-open it.  Your new From name should now appear in the drop-down list when you compose a new email.

  • HT2500 How do I change my Full Name on my mail account? I want to change from John Francis Woods to Francis Woods on all my .mac, .me and .iCloud mails.

    How do I change my Full Name on my mail account? I want to change from John Francis Woods to Francis Woods on all my .mac, .me and .iCloud mails.

    I have asked the hosts to consider editing out your name details for your own security.   I'm not sure what you should now do.    Go to https://getsupport.apple.com ; click 'See all products and services', then 'More Products and Services, then 'Apple ID', then 'Other Apple ID Topics' then 'Apple ID account Security'

  • For my iCloud account, how do I change the "full name" that appears as the sender?

    On my iCloud IMAP email account, the account lists my "full name" as the sender.  How do I change this to a nickname?  Curently, that "full name" rectangle is grayed out so I don't know how to change what's there.  Thanks for your help!

    You need to change this on the iCloud website, http://icloud.com - go to the Mail page, click the cogwheel icon at top right and choose 'Preferences', then click 'Accounts' in the toolbar of the pane which opens.
    Select the main account and you can change the Full Name. If you have aliases you will have to change it separately for each of them.

  • How do you remove your FULL name from the SYSTEM COMPLETELY?!?!

    I have added and removed the user thinking that would remove my full name from the system, but when I click on the "About this Mac" and then click on More info, My FULL NAME is still there as the owner of the computer. I am selling it and I do not want my name on the computer at all and do not wish to format the whole drive to do so. Is there another way of removing it? I appreciate anyone that has the correct answer.

    System Preferences>Sharing>Computer Name.
    BTW, unless you know and completely trust the person to whom you are selling, this is not the way to do things. Your sensitive data may still be recoverable.
    http://hivelogic.com/articles/how-to-prepare-a-mac-for-sale
    Choose zero out (one pass is sufficient.)

  • How can I change the "Full Name" for my iCloud account?

    Hello,
    At some point in the past, iCloud started identifying me as someone else when I send emails. This incorrect name appears to be the "Full Name" setting of the email account, but when modifying the properties for the email account in Mail the field for modifying the "Full Name" setting is disabled, not allowing me to make any changes.
    Where is the correct place to change the "Full Name" setting for my iCloud account?
    Thanks,
    - Josh
    <Email Edited By Host>

    I believe it can be changed by going to https://appleid.apple.com/, click Manage your Apple ID, sign in with your iCloud ID, select "Name, ID and Email Addresses", then click "Edit" next to the name listed under "Your Name" and change it as desired.
    Also, if you are trying to change the sender name for your iCloud email account, you'll want to go to icloud.com, sign into your account, open Mail, click the gear shaped icon on the bottom left and choose Preferences, go to the Accounts tab and enter the name you want to use in the Full Name field and click Done.  Then quit Mail (Command-Q) on your Mac and re-open it.  Your new From name should now appear in the drop-down list when you compose a new email.
    (The image was removed in your post above because it showed your iCloud email address.)

  • How do I convert multiple full sized DNGs to lossy DNGs within Lightroom?

    Hi,
    When I select multiple DNGs from within Lightroom, and on my mac go to menu>Library>Convert photo to DNG and then choose to convert to DNG with the lossy mode selected, only one of the selected DNGs is converted. How do I convert more at the same time? I have a large library, and I want to convert ~100gb of photos to lossy.
    Thanks in Advance!

    As far as my own collection goes, I would say I love about 1-2% of my pictures. I would like to use the top 5% for making printed family albums, and I use Lightroom to develop these images. The next 5-10% I would partially process and keep somewhere online at lower resolution, like on flickr. The next 20-40% I would like to keep around in storage, and the rest I trash.
    These last 20-40% that I want to keep would be fine as lossy DNGs. I would treat them as JPEGs that have a bit more dynamic range for the future, but as I shoot with a 24mp Nex-7, they are huge, and won't ever be pixel-peeped. I have examined the difference between my 25mb DNGs and the converted 7mb lossy DNGs, and for my uses, they are functionally identical.
    The issue is that I need to import them into Lightroom before I rate them. Once I rate my images, I flag the ones I want to work on further, and delete the worst. I would like a way to convert the remaining ones more easily. Of course if I knew which ones were 2nd-rate keepers from the outset, I would import them as lossy DNGs to start with.
    I often have 3-4000 images to process after a holiday, so I need a fast method of compressing these DNGs.

  • How not to show my full name in itune store

    when i publish the application,  how do i set it name instead of my full name

    If you are a developer uploading an app for sale, that's a question you should ask of Apple Developer Support through your iTunes Connect account. These are user-to-user support forums where few developers participate.
    Regards.

  • How do you convert Logical System Names of BW systems in BO

    Hi,
    We have implemented SSO where user/role administration takes place in BW, and then imported into BO where authorization to folders and reports are maintained. 
    What we are NOT yet able to figure out is how to move our BO groups (i.e. those groups that were automatically created from BW roles) and have them automatically mapped to the roles in the next environment. 
    Below is the scenario:
    BW Dev Environment
    System XXD
    Client   100
    Role     ZHR
    BO Dev Environment
    BW role ZHR has been imported and group XXD100@ZHR is automatically created. Also, we have granted group XXD100@ZHR access to different folders, reports and universes in this environment.
    BW Test Environment
    System XXT
    Client   200
    Role     ZHR has been transported from Dev
    BO Test Environment
    We are not quite sure how to import XXD100@ZHR from our BO dev enviroment and have the group automatically changed to XXF200@ZHR with the access to the different folders, reports and universes retained. Your help is highly appreciated.
    Regards,
    Olu

    Hi,
    We are not quite sure how to import XXD100@ZHR from our BO dev enviroment and have the group automatically changed to XXF200@ZHR with the access to the different folders, reports and universes retained
    >>>you actually do NOT want to have those roles imported because the role from you first system doesn't exist in the second system.
    You first system is pointing to system XXD with Client 100 and the second system is pointing to system XXF and client 200 - very different systems.
    the roles have to be imported as part of the overall SAP authentication configuration. In case this is about having a possible identical folder and security structure I would suggest you use also groups in the BusinessObjects system - standard BusinessObjects groups - use those to assign security and then assign the SAP groups as subgroups. In that way you keep the security configuration and only assign the right subgroups.
    ingo

  • TCA - How to define/convert Contact Person Name???

    Hi Guys,
    We have a requirement in our implementation where we need to define "CONTACT PERSON NAME" along with defining the contacts like Phone numbers, emails etc....
    We are using API - " hz_contact_point_v2pub.create_contact_point" to create a contact but this doenst allow us to define "Contact Person Name"
    Please advice....
    Cheers,
    KK

    Hi -
    Please use the below code to get the Contacts at the Account level.
    where Sold to Org id is the Customer Account Id.
    SELECT hp2.person_last_name||', '||hp2.person_first_name
    FROM apps.hz_parties hp,
    apps.hz_parties hp2,
    apps.hz_relationships hr,
    apps.hz_cust_accounts hca
    WHERE 1 = 1
    AND hca.party_id = hp.party_id
    AND hca.cust_account_id = :sold_to_org_id
    AND hr.subject_id = hp.party_id
    AND hr.relationship_type = 'CONTACT'
    AND hp2.party_id = hr.object_id
    AND hr.object_type = 'PERSON'
    AND hp.party_id = hr.subject_id
    Thanks
    Vyaghresh
    Edited by: user11990386 on Jun 20, 2011 2:33 PM

  • Change full name in iCloud mac mail

    How do I change a Full Name in iCloud mac mail?

    If you created a new iCloud account it would have a new associated iCloud email account.  You wouldn't be able to move your current @icloud.com address to the new account.
    Just to double-check, after quitting (Command-Q) and re-opening Mail, did you start an new message and click the down-arrow next to From to see if the new sender name was available from the drop-down list (see image below)?  If so, you might try signing out of iCloud entirely.  To do this, go to System Preferences>iCloud, click Sign Out, choose Delete at all of the prompts, restart your Mac, then sign back in and test Mail again.  (This deletes the account and your iCloud data from your Mac, but not from iCloud.  Your iCloud data will reappear on your Mac when you sign back in.)

  • Change FULL NAME in account information section?

    How do I change my full name under the account information section

    I had the same question, and found the answer here:
    http://reviews.cnet.com/8301-13727_7-57509815-263/how-to-change-your-icloud-mail -full-name/
    Basically,
    Log into icloud.com
    Click on the Mail icon
    Click on the Settings gear (top right), and pick "Preferences..."
    Click on Accounts
    Edit the Full Name
    Click Done
    The change should automatically propagate to your OS X machines and iOS devices.

  • Finding full name of app

    I was in iTunes, selected my iPad/Apps, and found a couple of versions of MineCraft were listed, one is installed, and the other isn't.   I found out from my grandson which version is the full version (MineCraft pocket), and wanted to make sure he would have the correct version next time he visited.
    But iTunes is showing them both with the same icon, and the name "Minecr...".    I tried right clicking on the icons to get more information.   That didn't work.   I tried double clicking.   Nothing happened.   (I thought one of those options would at least find it on my iPad, but nothing seems to happen).
    How do I display the full name of the app?

    Install them both, run them, then delete the one you don't want.

  • Changing my full name

    Hello,
    Several years ago I registered for an Apple ID with the name "XYZ". Since then, I have changed it to be "ABC" in my Apple ID configuration page, and it's indeed been updated.
    Currently I'm trying to register for an iOS dev program, but it appears that in the "Full Name" box there is "XYZ" again, without any option to change it.
    I tried to contact the iTunes Store Support, but this issue falls outside their specialty.
    How can I change my "Full Name" to be "ABC"?
    Thanks!

    Welcome to the Apple community.
    Start here, change your country if necessary and go to manage your account

Maybe you are looking for

  • I have fully updated firefox and flash however my sound still dosnt work?

    the sound work perfectly on my computer one day and the next the sound just stopped working, it is only on the internet my iTunes ect still work. i have updated everything and have checked my computer for viruses and have found nothing. can anyone he

  • Does anyone know when Release 2 will be released?

    Hi, I attended IOUG and an Oracle rep said that release 2 should be released in a couple of days. That was a week and half ago. Does anyone have a better idea. I really want to impliment Portal release 2.0 because it finally has the features I need.

  • IPhone calendar & contacts missing from desktop

    last night came home and my calendar & contact list are no longer on my desktop.  NO Idea where to look to get them back.  Still on my phone.

  • Hide pages containing invisible fields

    https://workspaces.acrobat.com/app.html#d=pYu*uOo7e-RMmuipvrpW5g Hello, I created this form and i have 20 checkboxes that when checked they each make a text box located below appear. My problem is that when no checkboxes are checked, the extra pages

  • How to hide Subject Areas

    Hi, I am using BI analytics Apps RPD. By default they are showing Subject Areas and Dashboards. I have already Hide the Dashboards. But i am not able to hide Suject Areas. How can i hide Subject Areas. Help me on this. Thanks