import re


def get_filenames(filename):
  """
  Return list of unique file references within a passed file.
  """
  try:
    with open(filename, 'r', encoding='utf8') as file:
      words = re.split("[\n\\, \-!?;'//]", file.read())
      #files = filter(str.endswith(('csv', 'zip')), words)
      files = set(filter(lambda s: s.endswith(('.csv', '.zip', '.pdf', '.txt', '.tsv', '.cfg', '.ini')), words))
      return list(files)
  except Exception as e:
    print(e)
    return []