Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
brijesh1991
Partner - Specialist
Partner - Specialist

Extract a part from String

I have few strings like

"sulko uspedo (00:20)+podendo (01:05)+Uskudento (05:01)"

"podendo (07:25)+sulko uspedo  droggen(05:50)+Uskudento (05:01)"

"podendo (04:85)+Uskudento (03:21)+sulko uspedo (02:15)"

 

I need to extract time after key word sulko*

Result of above 3 sample should be 00:20, 05:50, 02:15 respectively; any idea on extracting time after a specific keyword would be highly appreciated. Thank you!

 

Labels (3)
2 Replies
Gysbert_Wassenaar

Perhaps like this:

Example:
LOAD
    ExampleStrings,
    KeywordTimePart,
    SubField(KeywordTimePart, '(', 1) as Keyword,
    Time#(PurgeChar(SubField(KeywordTimePart, '(', 2),')'),'hh:mm') as Time
    ;
LOAD
    ExampleStrings,
        SubField(ExampleStrings, '+') as KeywordTimePart
    ;
LOAD * INLINE [
ExampleStrings
sulko uspedo (00:20)+podendo (01:05)+Uskudento (05:01)
podendo (07:25)+sulko uspedo droggen(05:50)+Uskudento (05:01)
podendo (04:85)+Uskudento (03:21)+sulko uspedo (02:15)
];

talk is cheap, supply exceeds demand
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

I would use TextBetween function like below:

LOAD *
	,TextBetween(Right(text, Len(text) - Index(text, 'sulko')), '(', ')') as Time
INLINE [
text
sulko uspedo (00:20)+podendo (01:05)+Uskudento (05:01)
podendo (07:25)+sulko uspedo droggen(05:50)+Uskudento (05:01)
podendo (04:85)+Uskudento (03:21)+sulko uspedo (02:15)
];

There is the results:

Screenshot_1.jpg