title: Python Parsing csv file containing ip and ports
body: <p>I'm working on small project that parse csv file</p>
  
  <p>so csv file I'm working on should contain IPs with opened ports separated with commas</p>
  
  <p>192.168.10.45,80,443,20,21,8080</p>
  
  <p>192.168.10.49,22,80,21</p>
  
  <p>So, I am trying to read this file then write an output file for each port that contain IP addresses for ip with that port opned. e.g.
  22.txt should contain </p>
  
  <p>192.168.10.45
  192.168.10.49</p>
  
  <p>Any idea how I could do that or a good reference. I am still noob in python3</p>
  
  <pre><code>import csv
  import sys
  
  with open(sys.argv[1], 'rt') as f:
  reader = csv.reader(f)
  for row in reader:
      print((row)[1])
  </code></pre>
  
  <p>Thanks in advance!</p>