def clean_and_split_line(line, make_lowercase=False):
    """
    Given a string representing 1 line of a CSV file, do the following:

    1. split on tabs
    2. remove double-quotes
    3. remove leading and trailing whitespace
    4. optionally lowercase each field (if make_lowercase is True)
    5. convert fields which are only a NULL byte to an empty string instead

    Return that list of fields.
    """
    # Yes, it would make much more sense to just use the csv module which handles delimiting and
    # quoting properly, but unforuntately some of the older datafiles includes null bytes, which
    # makes the csv module choke.
    line = line.split('\t')
    if make_lowercase:
        return [field.strip('"').strip().lower() if field != '\x00' else '' for field in line]
    else:
        return [field.strip('"').strip() if field != '\x00' else '' for field in line]