PHP код:
<?php
$strings = file("файл_с_урлами.txt");
$result_array = array();
for ($strings_c=0; $strings_c<sizeof($strings); $strings_c++)
{
preg_match_all("/(\d{1,3}\.){3}\d{1,3}\:\d{1,5}/", file_get_contents(trim($strings[$strings_c])), $matches);
$result_array = @array_merge($result_array, $matches[0]);
}
$result_array = array_unique($result_array);
natsort($result_array);
$file = fopen("result.txt", "w");
fwrite($file, implode(PHP_EOL, $result_array).PHP_EOL);
fclose($file);
?>