-
-
Save subhead/3f6b75e4dc258c31ac9a25995c3a14c3 to your computer and use it in GitHub Desktop.
Revisions
-
geek-at created this gist
Aug 21, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ <?php $infile = 'austria.csv'; $outfile = 'austria.ips'; $fp = fopen($outfile,'w'); $handle = fopen($infile, "r"); if ($handle) { while (($line = fgets($handle)) !== false) { $line = trim($line); $a = explode(',',$line); $from = str_replace('"','',$a[0]); $to = str_replace('"','',$a[1]); for($i=$from;$i<$to;$i++) { $ip = long2ip($i); fwrite($fp,$ip."\n"); if(++$j % 10000==0) echo "."; } } fclose($handle); } fclose($fp);