import re


def get_field_from_tsv(tsv_file, match_column, match_value, return_column):
  """Reads a TSV, matches on a column value and returns another column."""

  with open(tsv_file, 'r') as f:
    input_lines = f.readlines()

  fields = input_lines[0].strip().split('\t')
  match_column_idx = fields.index(match_column)
  return_column_idx = fields.index(return_column)

  for line in input_lines[1:]:
    fields = line.strip().split('\t')
    if re.search(match_value, fields[match_column_idx]):
      return fields[return_column_idx]