JohnnyBravo
12-26-2006, 11:40 AM
I've got a text file a friend of mine sent me with several URLs like thus:
pinot noir
http://www.someurl.com/hobbs/gorillar...noir.com
Spring autumn
http://www.someurl.com/hobbs/gorillar...tumn.com
zinfandel
http://www.someurl.com/hobbs/gorillar...fandel.com
As you can tell by the ellipses, the full URL got truncated somehow. (Some URLs got truncated and some did not). So I've been correcting the truncated ones by hand like this:
pinot noir
http://www.someurl.com/hobbs/gorillarms-pinot-noir.com
Spring autumn
http://www.someurl.com/hobbs/gorillarms-Spring-autumn.com
zinfandel
http://www.someurl.com/hobbs/gorillarms-zinfandel.com
There's too many URLs to correct by hand so now I need to turn to VBA for an appropriate solution.
So basically I need a way to inspect each line. If URL contains ellipses "arms...whatever.com" then replace it with "gorillarms-word1.com" or ""gorillarms-word1-word2.com" as in the example above. I've been searching on Google but nothing that matches situation at hand.
pinot noir
http://www.someurl.com/hobbs/gorillar...noir.com
Spring autumn
http://www.someurl.com/hobbs/gorillar...tumn.com
zinfandel
http://www.someurl.com/hobbs/gorillar...fandel.com
As you can tell by the ellipses, the full URL got truncated somehow. (Some URLs got truncated and some did not). So I've been correcting the truncated ones by hand like this:
pinot noir
http://www.someurl.com/hobbs/gorillarms-pinot-noir.com
Spring autumn
http://www.someurl.com/hobbs/gorillarms-Spring-autumn.com
zinfandel
http://www.someurl.com/hobbs/gorillarms-zinfandel.com
There's too many URLs to correct by hand so now I need to turn to VBA for an appropriate solution.
So basically I need a way to inspect each line. If URL contains ellipses "arms...whatever.com" then replace it with "gorillarms-word1.com" or ""gorillarms-word1-word2.com" as in the example above. I've been searching on Google but nothing that matches situation at hand.