fork download
  1. import re
  2.  
  3. #f=r'sample.txt'
  4. #text = open(f, 'r').read()
  5. text = r"""Submitted By,Assigned,Closed
  6. Name1,10,5
  7. Name2,20,10
  8. Name3,30,15"""
  9.  
  10. rePat = re.compile('^[^,\n]+,([^,\n]+),.*$', re.MULTILINE)
  11. output = re.findall(rePat, text)
  12. print (output)
Success #stdin #stdout 0.02s 9484KB
stdin
Standard input is empty
stdout
['Assigned', '10', '20', '30']