IP reverse lookup

March 13, 2010 at 22:13:03
Specs: Windows XP

Okay, here is my story and any suggestions would be appreciated. I sent a survey request to an international list of subjects when it should have been to U.S subjects only. Done deed, and no way to correct that problem.

However, the survey software collects the IP address of each respondent so I can create a list of IP addresses. I need to feed this to a looping program to look up each IP address, find the country, and record the IP address and country in a file that can then be imported into Access.

I hope someone can help this 'ole prof solve this dilemma.

See More: IP reverse lookup

Report •

March 14, 2010 at 03:51:16
I did a whois on my IP and got [a few relvant lines]:

inetnum: -
netname: TH_AIS_Mobile_Internet
descr: Assign for AIS_EDGE Customers
country: TH

Given that, the script below may get you a CSV file usable in Access.


@echo off > new.csv & setLocal enableDELAYedeXpansion

for /f "tokens=* delims= " %%i in (IPlist) do (
set D=
for /f "tokens=2 delims= " %%a in ('whois %%i ^| find /i "country" ') do (
  if not defined D (
    >> new.csv echo.%%i, %%a
set D=Y

Helping others achieve escape felicity


Report •

March 16, 2010 at 10:30:14
Thanks for your help. It is people like you that keep this world rolling.


Report •

Related Solutions

Ask Question