def file_to_dict_array(input_file, separator="\t"):
    """
    Turns a column based file into an array of dicts, where the keys are the column names
    So result[3]["first"] gets the value from the column with the name "first" and the fourth row
    """
    result = []
    with open(input_file, 'rU') as i:
        header = None
        for line in i:
            splt = line.rstrip().split(separator)
            if not header:
                header = splt
                continue
            result.append({header[i]: splt[i] for i in range(len(splt))})
    return result