title: Trying to sort integers but getting 'invalid literal for int() with base 10' error
body: <p>I'm trying to sort a list by the 8th column (after splitting the file) BUT I keep getting this error: </p>
  
  <pre class="lang-none prettyprint-override"><code>ValueError: invalid literal for int() with base 10: '72912,'
  </code></pre>
  
  <p>Here is my list I'm trying to sort:  </p>
  
  <pre class="lang-none prettyprint-override"><code>UDP outside 192.168.30.33:1046 inside 192.168.84.28:161, idle 0:00:18, bytes 72912, flags  
  TCP outside 192.168.120.26:1339 inside 192.168.84.17:445, idle 5:29:24, bytes 19305, flags  
  TCP outside 192.168.120.26:1271 inside 192.168.84.161:139, idle 5:29:41, bytes 4346, flags  
  TCP outside 192.168.120.60:1955 inside 192.168.84.100:445, idle 3:56:40, bytes 259388, flags  
  TCP outside 192.168.120.60:1951 inside 192.168.84.17:445, idle 3:56:40, bytes 257120, flags   
  TCP outside 192.168.120.60:1940 inside 192.168.84.161:139, idle 3:56:57, bytes 260372, flags  
  TCP outside 192.168.120.49:1324 inside 192.168.84.161:445, idle 5:04:12, bytes 2705, flags
  </code></pre>
  
  <p>Here's my Python script:</p>
  
  <pre><code>lines = open("home/file.txt", "r").readlines() 
  lines = [x.split() for x in lines] 
  lines.sort(cmp, key=lambda x:int(x[8]), reverse=True) 
  for i in lines: 
      print i 
  </code></pre>
  
  <p>Any help is really appreciated with this...</p>