Jump to content
Sign in to follow this  
Leb i Sol

variable or conditional trim of URLs

Recommended Posts

Hello eveyone,

I am trying to trim out the field that contains full urls into only domains.

Eg.

http://subdomain.domain.com/contact.html

http://images.yahoo.com/userx/folder/image.jpg

http://www.google.com/search?q=filemaker&rls=com.microsoft:en-us&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1

into:

http://subdomain.domain.com

http://images.yahoo.com

http://www.google.com

so I found this works:

Trim ( Substitute ( MiddleValues ( Substitute ( DestinationURL; ".com"; "¶"); DestinationURL; 1); "¶"; "" ) )&".com"

------------------------- ------------

but how to implement some form of variable to cover all domain extensions?(tv,org,edu,com,...)

my poor logic would be:

-------------------------------------

DomainVAR = .net .com .tv ....(all possible)

Trim ( Substitute ( MiddleValues ( Substitute ( DestinationURL; "DomainVAR"; "¶"); DestinationURL; 1); "¶"; "" ) )&"DomainVAR"

-------------------------------------

Or does this have to be scripted?

Thanks for your time!

Share this post


Link to post
Share on other sites

How about:

Let (

text = MyURL & "/"

;

Left ( text ; Position ( text ; "/" ; 1 ; 3 ) - 1 )

)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.