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):
22.214.171.124 at.ask.com www.at.ask.com 126.96.36.199 maps.googleapis.com www.maps.googleapis.com 2400:cb00:2048:1::6812:32a5 litscape.com www.litscape.com 188.8.131.52 loc.gov www.loc.gov 184.108.40.206 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