def build_grid(filename):
    """Scrapes a formatted text file and converts it into a word search grid.

    Args:
        filename: A text file containing rows of alphabetical characters,
            optionally separated by spaces or commas. Each row must contain the
            same number of letters.

    Returns:
        A 2d list, representing the rows and columns of the word search grid.
    """
    grid = []

    input_file = open(filename, 'r')
    for line in input_file.read().splitlines():
        # Ignore separators
        line = line.replace(' ', '')
        line = line.replace(',', '')
        row = list(line)
        grid.append(row)
    input_file.close()

    return grid