I have a large list of IP addresses (most are IPv4, but a few are IPv6), followed by a space and then a domain name, followed by another space and the same domain name with "www." in front of it. Each instance is on it's own line. The list looks like this (but is much larger):
220.127.116.11 at.ask.com www.at.ask.com 18.104.22.168 maps.googleapis.com www.maps.googleapis.com 2400:cb00:2048:1::6812:32a5 litscape.com www.litscape.com 22.214.171.124 loc.gov www.loc.gov 126.96.36.199 mbu.edu www.mbu.edu
I would like to know two find and replace commands; each to generate another text file after the last.
1) The first command should find and replace everything before the "www." with "http://" so that the lines of the second text file will look like this:
http://www.at.ask.com http://www.maps.googleapis.com http://www.litscape.com http://www.loc.gov http://www.mbu.edu
2) The second command should find and replace all instances of "http://www." in the second text file so that the lines of the third text file will look like this:
at.ask.com maps.googleapis.com litscape.com loc.gov mbu.edu