Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Extracting String

Hi all

I am looking at extracting all of the text up to a full stop in a field called "Comments" - does anyone know the code to do this?

Thanks in advance,

Chris

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Or:

subfield(Comments,'.',1)

If there's no full stop, it should return the entire Comments field. I assume that's what you want.

View solution in original post

4 Replies
Not applicable
Author

I assume you're referring to a period character as a 'full stop'

You'll have to handle cases where there is no 'full stop', but this should set you on your way:

Left([your field], FindOneOf([your field], '.'))


sicilianif
Creator II
Creator II

If I am reading what you wrote correctly, you could do something like this:

Left(Comments,index(Comments, '#')-1)

Just replace the # with whatever character(s) you want to stop extracting at.

For example, if comments was this: "This is a test#Something Else", the above code would return "This is a test".

Frank

johnw
Champion III
Champion III

Or:

subfield(Comments,'.',1)

If there's no full stop, it should return the entire Comments field. I assume that's what you want.

Not applicable
Author

Excellent, thanks for your help