def keep_numbers(file):
    """Get all ints in the file text."""
    cleaned = []
    with open(file, "r", encoding="utf-8") as f:
        f = f.readlines()
        for line in f:
            filtered = list(map(int, filter(lambda x: x.isnumeric(), line)))
            # alternative:
            # filtered = [int(e) for e in line if e.isnumeric()]
            if len(filtered) > 0:
                strings = "".join(list(map(str, filtered)))
                cleaned.append(int(strings))
    return cleaned