Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm struggling with an expression in which I want to trim and only bring in certain text from a field.
For example, I have : The Dog Walked into the room. I only want to bring in 'Walked into the room'
Any help would be appreciated!
Thanks.
saffatwist wrote:
Basically, I'd like to return all the text to the right of the end of 'The Dog '
So, if the text is 'The Dog jumped into the pool', I always want to return all text to the right of 'The Dog '. ie. 'jumped into the pool'
TextBetween(Field, 'The Dog', '')
-Rob
I think you need to better specify for us what you want to do.
For your specified example you could use:
Right(text,20)
Basically, I'd like to return all the text to the right of the end of 'The Dog '
So, if the text is 'The Dog jumped into the pool', I always want to return all text to the right of 'The Dog '. ie. 'jumped into the pool'
I hope this is more clear.
Thanks
Example:
LOAD * INLINE [
F1
The Dog jumped into the pool
The Dog Walked into the room
];
subfield(F1,'The Dog',-1)
I think something like this!!!!!
RIGHT('The Dog jumped into the pool' , index( 'The Dog jumped into the pool', 'The Dog' ) + len(The Dog))
index( 'The Dog jumped into the pool', 'The Dog' ) - First you find the start position....
Len('The Dog') - Second you find size of what you whant remove
ADD two expression to find where you start in the right function
and after you get a phrase without The Dog!!!!
Field = 'The Dog walked into the room. The Dog did something else.'
mid(Field,len('The Dog ')) = 'walked into the room. The Dog did something else.'
subfield(Field,'The Dog ',2) = 'walked into the room. '
subfield(Field,'The Dog ',-1) = 'did something else.'
saffatwist wrote:
Basically, I'd like to return all the text to the right of the end of 'The Dog '
So, if the text is 'The Dog jumped into the pool', I always want to return all text to the right of 'The Dog '. ie. 'jumped into the pool'
TextBetween(Field, 'The Dog', '')
-Rob