title: extracting names out of a string in python
body: <p>First, the purpose is to distinguish only names from a string that is consist of Korean names, English names, special characters (-,*,comma), whitespaces, etc. and to leave only one if a name is duplicated.</p>
  
  <p>So, what I've done so far is I've taken a text file and converted it into a string, eliminating unnecessary special characters.</p>
  
  <pre><code>import re
  
  path = 'E:\Data Science\Personal_Project\Church\Data\original.txt'
  
  def open_text(path):
      with open(path, "r", encoding='euc-kr') as f:
          text = f.readlines()
          string = ''.join(text)
          unicode_line = string.translate({ord(c): None for c in '.;*\n'})
          cleaned = re.split('-|', unicode_line)
  
  
  print(unicode_line, type(cleaned))
  return(cleaned)
  </code></pre>
  
  <p>Here's the question. What I want to add to Function above</p>
  
  <p>1) If there's a letter in front of a dashed line (e.g., "Attendance ---"), I want to remove the text in front of it (e.i., "Attendance") before splits it on dashes.</p>
  
  <p>2) Or I'd like to make a list -- [Attendance, Check-Out, Vacation] -- and I'd like to remove the words that are included in the list.</p>
  
  <p>I would appreciate it if you could tell me a better way or a more pythonic way of doing it!!</p>
  
  <p>For your convenience, I'll add a sample text.</p>
  
  <pre><code>Status of January 20th
  
  
  
  
  ** Attendance
  -----------
  
  John Smith, John Smith, Bob Smith, Mike Smith, Jane Jones, Daniel Lee, Dong Jones, Jeannie Jones, Jessica Yi, McAleer Chung, Shu K Smith, Song Kim, Steve Carlos, Bob Smith
  
  
  
  
  
  ** Absent
  ---------
  
  holiday, unauthorized, unpaid leave, emergency
  ------------------------------------------------------------------------------------------- 
  Brown Williams, Paul Garcia
  </code></pre>
  
  <p>Also, here is my desired output with only unduplicated names. If you see above, there are two John Smith and two Bob Smith. Lastly, it will be awesome if I can get it in Alphabetical order.</p>
  
  <pre><code>Output:
  
  
  John Smith, Bob Smith, Mike Smith, Jane Jones, Daniel Lee, Dong Jones, Jeannie Jones, Jessica Yi, McAleer Chung, Shu K Smith, Song Kim, Steve Carlos, Brown Williams, Paul Garcia
  </code></pre>