Jump to content

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

Recommended Posts

Posted

I need to pull out the right words from a text field. The information in the field is separated by a comma ... sometimes one comma ... other times more than one. I only need the text that follows the last comma.

Example 1: Mary Had A Little Lamb, cassette - sheet music (the calculated result should be: cassette - sheet music)

Example 2: World Is Round, The, VHS (the calculated result should be: VHS)

Posted

One way would be...

Let ( [

// Change to a return seperated list

Step1 = Substitute(MyTextField; ","; ¶) ;

// Get the last value in list

Step2 = RightValues(Step1;1);

// Remove trailing Carriage Return

Step3 = Substitute(Step2; ¶; "");

// Trim it up

Step4 = Trim(Step3)

]

; Step4 )

Posted

Why do you think 1NF says one fact per field? Anyways here's my stab at it:

Let(rough= yourString ;Replace ( rough ; 1 ; 1+Position ( rough ; ","; 1 ; Length(Filter ( rough ; "," )) ) ; "" ))

What it does, is taking the last comma, and get the text following it!

--sd

Posted

WORKS PERFECTLY :-)

WOW !!!

THANK YOU SO MUCH :-)

Posted (edited)

How about something simple:

Let ( [

len = Length ( text )

] ;

Right ( text ; len - Position ( text ; ", " ; len ; -1 ) - 1 )

)

Edited by Guest
Posted

Indeed much better, I havn't noticed this:

A negative occurrence value causes the scan to go in the opposite direction

Thanks Michael!!

--sd

Posted

Thank you everyone ... I love all the different answers.

This topic is 6384 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.