AlanP Posted August 29, 2007 Posted August 29, 2007 Hi everyone...I'm trying to convert an employees name and ID number to email format. The only part I'm getting stuck on is the employees name. Payroll provides it electronically as one field as such: LAST,FIRST MI, Our email is configured as [email protected] (where "F" is the first initial of the first name and "L" is the first initial of last name and 1234 is a 4 or 5 digit ID number unique to the employee). So I need to somehow take the L and F (using the example above) and place it in a calculation. Does anyone have any ideas on how to do this?
Vaughan Posted August 29, 2007 Posted August 29, 2007 The comma is a word separator, as is the space. Read up on FMP's LeftWords, MiddleWords and RightWords text functions. As long as the text supplied by payroll is *always* in that format you should be OK.
aldipalo Posted August 30, 2007 Posted August 30, 2007 Thanks Vaughn for the hint. I've been playing with this thing for over 4 hours. I'm terrible with text functions. (Didn't know that until today.) : Here's what I came up with. Hope it helps you AlanP. Left(MiddleWords (FullName ; 2 ; 1 );1) & ContactID & Left (FullName; 1) & "@abc.com"
AlanP Posted August 30, 2007 Author Posted August 30, 2007 I'm crying with happiness! LOL : Thank you both for your help and thank you aldipalo for providing the code as my mind is numb from trying to figure this out for too long :D
Vaughan Posted August 30, 2007 Posted August 30, 2007 It looks good. My only suggestion, since I'm hopelessly risk-averse, is to introduce you to the Trim( ) function, which is built-in FMP, and the Trim4( ) custom function by Ray Cologon, found on Brian Dunning's web site. Trim( ) strips leading and trailing spaces, which are quite commonly added by data entry people. Trim4( ) removes leading and trailing spaces, non-breaking spaces, tabs and carriage returns. I include Trim4( ) in all text handling functions to clean up the input.
Recommended Posts
This topic is 6356 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now