Newbies Steven Thompson Posted April 14 Newbies Posted April 14 Looking for script to parse Domain Name (content between "//" and "/" of full URL). Ideal would be to add script to existing script (pastes full URL). Parsed content to be pasted info field "Domain." I'm a new member. Already searched the forum for "domain parser" and came up empty (surprisingly). Resources found through Yahoo search didn't work. Thanks in advance.
comment Posted April 14 Posted April 14 (edited) 4 hours ago, Steven Thompson said: Looking for script to parse Domain Name (content between "//" and "/" of full URL). This would be a job for a calculation, not a script. You can use such calculation in a script, for example to do: Set Field [ YourTable::Domain ; «the calculation» ] Now, the calculation itself could be simply: Let ( [ start = Position ( URL ; "/" ; 1 ; 2 ) ; end = Position ( URL ; "/" ; 1 ; 3 ) ] ; Middle ( URL ; start + 1 ; end - start - 1 ) ) or even: GetValue ( Substitute ( URL ; "/" ; ¶ ) ; 3 ) -- P.S. Strictly speaking, the substring between "//" and the next "/" is called the authority, and it includes the domain and optionally the port - see: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL Edited April 14 by comment 1
Newbies Steven Thompson Posted April 14 Author Newbies Posted April 14 Ah, being a calc vs script would explain my frustration! Thanks also for the technical definitions about URLs.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now