Jump to content

This topic is 5553 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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!

Posted

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.

  • 7 months later...
Posted

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)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.