title: Split up CSV column contents into multiple columns
body: <p>I am trying to tie another piece into my existing Python program. I am new to Python and can't seem to figure it out, even with all of the help out there. I will list my existing Python program below, I would just like to add in the other piece to perform another task.</p>
  
  <p>The current program opens "initial.csv" and looks in the first column for any key words. If it matches one, it writes the line in "listname_rejects.csv" and any that don't match, it writes into "listname.csv". It sounds backwards, but for what I'm doing, it's correct. I've used it a thousand times.</p>
  
  <p>Now, what I would like to add into this, is the ability to look at column 2 (Full of addresses) and split them up into separate columns. For example, this - </p>
  
  <pre><code>Name,Address,Phonenumber,ID
  John,"123 Any Street, New York, NY 00010",999-999-9999,321654
  </code></pre>
  
  <p>Turns into this - </p>
  
  <pre><code>Name,Street,City,State,Zipcode,Phonenumber,ID
  John,123 Any Street, New York, NY, 00010,999-999-9999,321654
  </code></pre>
  
  <p>Basically, I need to be able to explode the second column into separate columns. Rather than having the entire address in column 2, I need to split it up between say column 2, 3, 4, &amp; 5.</p>
  
  <p>I have found things close to this on stack overflow, but again, I'm new to Python and can't figure out how to piece them into my current code.</p>
  
  <pre><code>key_words = [ 
  'Suzy', 
  'Billy', 
  'Cody',
   ]
  
  listname = raw_input ("Enter List Name:")
  listname_accept = (listname) + '.csv'
  listname_rejects = (listname) + '_rejected.csv'
  
  with open('initial.csv', 'r') as oldfile, open(listname_accept, 'w') as cleaned:
      for line in oldfile:
          if not any(key_word in line.split(",", 1)[0] for key_word in key_words):
              cleaned.write(line)      
          else:
              matched.write(line)
  </code></pre>