def scrapeIPs(filename):
    'Scrapes all IP addresses from a logfile.\n    '
    file = open(filename, encoding='utf-8')
    logfile_reader = csv.reader(file)
    print('Getting the size of the logfile....\n')
    logsize = sum((1 for row in logfile_reader))
    file.seek(0)
    next(logfile_reader)
    row = next(logfile_reader)
    ip_column = findIpColumn(row)
    file.seek(0)
    next(logfile_reader)
    print((('Processing ' + str(logsize)) + ' entries.'))
    iterator = 0
    all_ip_address = []
    for entry in logfile_reader:
        try:
            entry_ip_address = entry[ip_column]
            all_ip_address.append(entry_ip_address)
            iterator = (iterator + 1)
            if ((iterator % 1000) == 0):
                percentDone = round(Decimal(((iterator / logsize) * 100)), 2)
                string = (((((('Currently: Scraping all IPs from file. Entry ' + str(iterator)) + ' of ') + str(logsize)) + ' Percent Done: ') + str(percentDone)) + '%.')
                print(string, end='\r')
        except UserWarning:
            print((('\n* * * Invalid entry detected on line ' + str(iterator)) + '.'))
            iterator = (iterator + 1)
            print('Line data: ')
            print('Using column {} for IP address.'.format(ip_column))
            print('Data from that column, for this entry, was {}.'.format(entry[ip_column]))
            print(entry)
    print('\n')
    return all_ip_address
Scrapes all IP addresses from a logfile.
def scrapeIPs(filename):
    '\n    '
    file = open(filename, encoding='utf-8')
    logfile_reader = csv.reader(file)
    print('Getting the size of the logfile....\n')
    logsize = sum((1 for row in logfile_reader))
    file.seek(0)
    next(logfile_reader)
    row = next(logfile_reader)
    ip_column = findIpColumn(row)
    file.seek(0)
    next(logfile_reader)
    print((('Processing ' + str(logsize)) + ' entries.'))
    iterator = 0
    all_ip_address = []
    for entry in logfile_reader:
        try:
            entry_ip_address = entry[ip_column]
            all_ip_address.append(entry_ip_address)
            iterator = (iterator + 1)
            if ((iterator % 1000) == 0):
                percentDone = round(Decimal(((iterator / logsize) * 100)), 2)
                string = (((((('Currently: Scraping all IPs from file. Entry ' + str(iterator)) + ' of ') + str(logsize)) + ' Percent Done: ') + str(percentDone)) + '%.')
                print(string, end='\r')
        except UserWarning:
            print((('\n* * * Invalid entry detected on line ' + str(iterator)) + '.'))
            iterator = (iterator + 1)
            print('Line data: ')
            print('Using column {} for IP address.'.format(ip_column))
            print('Data from that column, for this entry, was {}.'.format(entry[ip_column]))
            print(entry)
    print('\n')
    return all_ip_address