I have downloaded IP2Proxy™ LITE database in CSV format, below is the data in it:
How can I read the IP addresses using Python or PowerShell, as it seems in plain number, rather than a standard dotted quad. Also, please explain what does the first two columns represent.
Here's how you can convert those values into a string representation of an IPv4 address:
def convert(ip):
def _genip(n):
for shift in range(24, -8, -8):
yield f'{(n >> shift) & 0xff:03d}'
return '.'.join(_genip(int(ip)))
print(convert('34676992'))
Output:
002.017.033.000