#!/usr/bin/perl $| = 1; print "\nBuilding data.new..."; open( IN, "GeoIPCountryWhois.csv" ) or die "Can't open GeoIPCountryWhois.csv\n"; open( OUT, ">data.new" ) or die "Can't create data.new\n"; while( $line = ) { chomp $line; $line =~ s/\"//gx; my ( $startIpNum, $endIpNum, $junk, $junk, $countryShort, $countryLong ) = split /,/, $line; print OUT "%$countryShort:$startIpNum:$endIpNum\n"; } print "\nDone\n";