title: Print only second part of a string split
body: <p>Trying to split a string by <code>--</code> character and want to print the data after <code>--</code>.</p>
  
  <p>Eg :</p>
  
  <pre><code>1.Cleveland-Elyria-Mentor    OH--17460
  2.Dallas-Plano-Irving    TX  (MSAD)--19100
  etc.
  </code></pre>
  
  <p>How to print only :</p>
  
  <pre><code>a.TX (MSAD)
    OH
  </code></pre>
  
  <p>and</p>
  
  <pre><code>b. 17460 
     19100 
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>   #!/usr/bin/python
     import csv
     import re
  
     sample="""columnA,ColumnB,columnC
     1,Cleveland-Elyria-Mentor    OH--17460
     2,Dallas-Plano-Irving    TX  (MSAD)--19100
     3,ASJDFJKDJ-kD-JE       WA--21092"""
  
  
     open('sample.csv','w').write(sample)
     with open('sample.csv') as sample, open('final_output.csv','w') as output:
     reader = csv.reader(sample)
     writer = csv.writer(output)
     # discard input header
     next(reader)
     # write output header
      writer.writerow(['col1','col2','col3'])
      #process rows
     for row in reader:
          if row:
                  for stsplit in re.split(r'--', row[1]):
                      writer.writerow([row[0], stsplit, row[1]])
  
  
     print open('final_output.csv').read()
  </code></pre>