cuppanews Posted July 19, 2005 Report Share Posted July 19, 2005 Hi... I want to take a URL and extract the domain name. I've written a macro that does this, but since it's something that's critical to my workflow, I'd like to ask for your thoughts. Is this the best way to do what I want? Are there any obvious flaws in what I've done? The aim here is to get the domain name into T4. The URL is in T2, a variable that is restored when the macro begins. // Restore all variables from memory.Variable Restore All Variables // Extract domain name. // Strip "http://".'>http://". Replace "http://" with "" in %T2% // Put the position of the first remaining slash (i.e., end of domain name + 1) into an integer variable: N1 Variable Set Integer %N1% from Position of Text in Variable %T2% // Reduce the value of N1 by 1. Variable Modify Integer: %N1% = %N1% - 1 // Copy everthing from position 1 to N1 into T4. Variable Modify String: Copy Part of %T2% to %T4% Thanks for your help! M. Quote Link to comment Share on other sites More sharing options...
randallc Posted July 20, 2005 Report Share Posted July 20, 2005 Hi, For my 2-penneth, looks OK to me! Good luck, Randall Quote Link to comment Share on other sites More sharing options...
cuppanews Posted July 20, 2005 Author Report Share Posted July 20, 2005 Thanks, Randall. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.