Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. |Username|Host|Connected|Idletime|ECM|EMM|Version|Lastusedshare|
  2. |astracanal|188.95.48.8|00d00:09:43|00d00:04:30|14(0)|0(0)|2.1.3|0604:000000:1bc0(nok)|
  3. |canalnl|82.72.48.10|00d00:09:41|00d00:09:41|0(0)|571(571)|2.1.2||
  4. |telesatt|94.23.36.22|00d00:09:41|00d00:02:10|6(0)|0(0)|2.1.2|0604:000000:119a(nok)|
  5. |dream9|41.226.253.19|00d00:09:40|00d00:04:31|29(3)|58(58)|2.1.4|0604:000000:02c4(nok)|
  6. |dream10|85.218.13.10|00d00:07:09|00d00:00:06|59(56)|0(0)|2.1.3|0500:021110:01ae(ok)|
  7. |papa|192.168.1.13|00d00:00:56|00d00:00:56|1(1)|0(0)|2.1.3||
  8. |Username|Shareinfo|
  9. |astracanal|local0604:00000014(0)||canalnl||
  10. |telesatt|local0604:0000006(0)|
  11. |dream9|local0604:00000025(0)|
  12. ||remote0500:0424004(3)|
  13.  
  14. step3:
  15.  
  16. #!/usr/bin/env python
  17. # -*- coding: UTF-8 -*-
  18. #
  19.  
  20. from csv import reader, writer
  21.  
  22. outs = dict((s, writer(open('outputfile' + s, 'w'), delimiter='|')) for s in ['2.1.3'])
  23. for row in reader(open('cli1.txt'), delimiter='|'):
  24. if row[6] in outs:
  25. outs[row[6]].writerow([row[1]])
  26.  
  27.  
  28. my output is: (outputfile2.1.3)
  29.  
  30. 188.95.48.8
  31. 85.218.13.10
  32. 192.168.1.13
  33.  
  34. but i need all the ips in outputfile2.1.3 file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement