Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
EvoticTalend
Contributor
Contributor

How to extract a substring from a "/" to "." ?

Hello everyone, I've had a difficult day searching how to extract a string from a "/" to a ".".

Example: https://ilursei.com/photos/1943/161317/077666rtryfggghvbvnfggfh46546rtrtrg4_123.jpg

I want to extract only the large series of numbers "

077666rtryfggghvbvnfggfh46546rtrtrg4_123" to before ".jpg"

I tried tExtractRegexFields, some StringHandlings functions like CHANGE or eExtract but none result.

Labels (3)
12 Replies
EvoticTalend
Contributor
Contributor
Author

Hi again Prakhar! Thank you for the response.

 

 

--I have already this flow:

0695b00000G2sgEAAR.png--In the JavaFlex I have your code with the correct name of the column.

int first,second; String text;

first = (row5.url_video).lastIndexOf("/");

second = (row5.url_video).lastIndexOf(".");

text = (row5.url_video).substring(first+1, second);

 

 

 

--In the tMap this is the view:

0695b00000G2sgxAAB.png 

The problem now is this row6.url_video isn't the code I extracted in the JavaFlex, is the entire column (the link).

I think Im doing something wrong in the process from JavaFlex to tMap. What is the column in the tMap transformed in the JavaFlex?

 

 

Sorry for the questions, but I never worked in a process like this, extracting and sending to a DDBB, thanks.

Prakhar1
Creator III
Creator III

You have to goto edit schema of tJavaFlex and add a column as "text".

Now add one more line in the code

first = (row5.url_video).lastIndexOf("/");

second = (row5.url_video).lastIndexOf(".");

text = (row5.url_video).substring(first+1, second);

row6.text = text; ##new_line

 

Remember to write this code in the main part of tJavaFlex

Now after that you will see a new column "text" in tMap, use it to join with the other file column

EvoticTalend
Contributor
Contributor
Author

Thank You Prakhar, seems working.! Resolved.