Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find string in URL then extract the string plus everything after it 1

Status
Not open for further replies.

kernal

Technical User
Feb 27, 2001
415
US
I'm using crystal 9 with a txt file. In a URL, I need to search for a certain word (the word could change so I want to use a parameter) then retrieve that word plus everything after it. Example:

If I have the word "life" in a URL then I want to search for the word "life", retrieve the word "life" and everything after it in the URL. The word could be any where in the URL (i.e. could be position 26, position 30, etc.)

Help is appreciated.
 
Create a parameter {?keyword} and then create a record selection formula like this:

{table.URL} like "*"+{?keyword}+"*"

Then for display purposes add a formula like this to your detail section:

mid({table.URL},{?keyword})

-LB
 
mid({table.URL},{?keyword})" formula gives me an error "a number is required here."

Thanks for helping me.
 
Sorry, that should have been:

mid({table.URL},instr({table.URL},{?keyword}))

-LB
 
Thank you lbass. It worked GREAT!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top