dev_synaptech Posted April 4, 2009 Posted April 4, 2009 Hi, I have a text field that contains size and color data separated by a "-" dash. i.e. record (1) red - XL record (2): crystal blue - small record (3): black/light blue - large record (4): mediterranean blue/ speckled black (45) - extra small .. and so on I am looking to parse everything to the left and to the right of the "-" dash into two other fields (color) and (size). I am having trouble accounting for the variability of the location of the dash in building my calculation. Within this field, there is one and only one occurrence of the "-" dash. Any help pointing me in the right direction would be appreciated!
comment Posted April 4, 2009 Posted April 4, 2009 Try: Color = Left ( text ; Position ( text ; "-" ; 1 ; 1 ) - 1 ) Size = Right ( text ; Length ( text ) - Position ( text ; "-" ; 1 ; 1 ) ) If the dash is surrounded by spaces (as in your example), then adjust the formula or use Trim() on the result.
dev_synaptech Posted April 4, 2009 Author Posted April 4, 2009 Comment, Worked perfectly. Many thanks -much gratitude.
hall312 Posted November 19, 2009 Posted November 19, 2009 How about pulling the number after the first dash and before the second on this example: 09-[color:red]789-ROBB-5 In my limited knowledge I got this calculation but it doesnt account for the number in question being either 3 or 4 digits long. Middle (CaseNumber_pkid ; 4 ; 4)
Lee Smith Posted November 19, 2009 Posted November 19, 2009 Try MiddleWords( Substitute (CaseNumber_pkid; "-"; " "); 2; 1 )
comment Posted November 19, 2009 Posted November 19, 2009 See also: http://fmforums.com/forum/showpost.php?post/289685/
Recommended Posts
This topic is 5553 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