Skip to Content
0

Extract the text between two specified start and end strings in a field

Apr 16 at 11:10 AM

24

avatar image

Hi there

I need to extract the text from between two specific strings in a field.

For example, the field may look like this:

#Metalwork - Enamel#Cabinet 4 Shelf 2###This is the label text I want to extract.####

I want to extract the text between ### and ####; in other words, I want to extract "This is the label text I want to extract."

Can anyone advise the formula I need to do this? I've tried several options that I've found on forums, but so far none work.

cheers

Karen

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Ido Millet Apr 16 at 01:06 PM
0

Use the ExtractString function:

ExtractString(Yourfield, "###", "####")
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Ido

You learn something new every day. Never used ExtractString() before, certainly much easier to use.

Ian

0

Awesome thanks! I agree, a very neat solution!

many thanks

Karen

0
Ian Waterman Apr 16 at 11:51 AM
0

You can use Instr() function

Instr(YourField, '###') will return character number of first #

Then use mid()

Mid(Yourfield, Instr(YourField, '###')+3, Instr(YourField, '####')-1)

Ian

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi there Ian

Many thanks for your reply... I had just worked out how to do that when I saw your answer... then saw Ido had piped in with that ExtractString magic!

cheers for your awesome response anyway :-)

Karen

0