   #{suggestionPrompts}
   Choose a number, type a name, enter to skip, or q to quit.
   > """
+
+openTSV = (userToSchool, suggestions) ->
+  header = ['#', 'School Name', 'Matches', 'Name', 'Email', 'Age', 'Signup', 'Last Level', 'Points', 'Referrer', 'HoC'].join '\t'
+  rows = [[0, userToSchool.schoolName, '', formatUser(userToSchool, null, '\t')].join '\t']
+  for s, i in suggestions
+    matches = s.reasons.length + ' ' + if s.reasons.length > 1 then 'Matches' else 'Match' + ': ' + s.reasons.join(', ')
+    rows.push [i + 1, s.schoolName, matches, formatUser(s.user, userToSchool, '\t')].join '\t'
+  contents = [header].concat(rows).join('\n') + '\n'
+  path = "#{process.env.HOME}/Downloads/#{userToSchool.emailLower}.tsv"
+  fs.writeFile path, contents, {flags: 'w'}, (err) ->
+    console.log 'Error writing school suggestions TSV:', err if err
+    exec "open -a /Applications/Numbers.app #{path}"
 
 checkedTopGroups = {}
 findUserToSchool = (users) ->

      console.log "Incorrect number #{number} higher than max: #{max}"
  numbers

formatUser = (user, relativeToUser) ->
  # TODO: replace date string with relative time since signup compared to target user, and actually make suggestions based on students that signed up at almost the same time
  props = _.pick(user, ['name', 'emailLower', 'ageRange', 'dateCreated', 'lastLevel', 'points', 'referrer', 'hourOfCode'])
  props.dateCreated = if relativeToUser then moment(props.dateCreated).from(relativeToUser.dateCreated) else moment(props.dateCreated).fromNow()
  _.values(props).join('  ')

formatSuggestions = (userToSchool, suggestions) ->
  suggestionPrompts = ("#{_.str.rpad(i + 1, 3)}  #{_.str.rpad(s.schoolName, 50)} #{s.reasons.length} #{if s.reasons.length > 1 then 'Matches' else 'Match'}: #{s.reasons.join(', ')}\tfrom user: #{formatUser(s.user, userToSchool)}" for s, i in suggestions).join('\n')

          when 'IP' then 40
          when 'Referrer' then 20
          when 'Name' then 15
          when 'Domain' then (if getDomain(target) in ['cps.edu', 'mynewcaneyisd.org', 'fsusd.org', 'edison.k12.nj.us'] then 1 else 10)
          when 'Clans' then 0.01
    sum
  ), 0
