import linecache


def get_target(filepath, target_idx):
    """get target string from file"""
    line = linecache.getline(filepath, target_idx + 2)
    # split on tab and get second value, which is the target
    # strip newline and split on whitespace
    line = line.split("\t")[1].strip()
    return line