title: Get the nth column out of a text document (Python 3)
body: <p>I'm trying to write code that will allow Linux Mint users to install all recommended packages for any software that is already installed on their machine. To get the list of packages already installed, I run the following in bash:</p>
  
  <pre><code>grep 'install' /var/log/dpkg.log
  </code></pre>
  
  <p>This returns something like this:</p>
  
  <pre><code>2015-09-24 19:39:01 install libportsmf0:amd64 &lt;none&gt; 0.1~svn20101010-4
  2015-09-24 19:39:02 install libsbsms10:amd64 &lt;none&gt; 2.0.2-1
  2015-09-24 19:39:03 install libsoxr0:amd64 &lt;none&gt; 0.1.1-1
  2015-09-24 19:39:04 install libwxbase3.0-0:amd64 &lt;none&gt; 3.0.2-1+b1
  2015-09-24 19:39:05 install libwxgtk3.0-0:amd64 &lt;none&gt; 3.0.2-1+b1
  2015-09-24 19:39:07 install libvamp-hostsdk3:amd64 &lt;none&gt; 1:2.5-dmo6
  2015-09-24 19:39:08 install audacity-data:all &lt;none&gt; 2.0.6-2
  2015-09-24 19:39:10 install audacity:amd64 &lt;none&gt; 2.0.6-2
  2015-09-25 11:47:36 install hardinfo:amd64 &lt;none&gt; 0.5.1-1.4
  2015-09-25 12:14:35 install libstdc++6:i386 &lt;none&gt; 4.9.2-10
  2015-09-25 12:14:36 install libudev1:i386 &lt;none&gt; 215+12+betsy
  2015-09-25 12:14:37 install libtinfo5:i386 &lt;none&gt; 5.9+20140913-1+b1
  2015-09-25 12:14:38 install libbsd0:i386 &lt;none&gt; 0.7.0-2
  2015-09-25 12:14:39 install libedit2:i386 &lt;none&gt; 3.1-20140620-2
  2015-09-25 12:14:40 install nvidia-installer-cleanup:amd64 &lt;none&gt; 20141201+1
  </code></pre>
  
  <p>What I need is to be able to grab the fourth column of each line where it says the package name. So libportsmf0:amd64, libsbsms10:amd64...
  Up to this point, I've tried piping the output of grep 'install' to a file, opening the file with Python 3, and using a for loop to grab the third column, such that</p>
  
  <pre><code>import os
  def recommends():
      os.system("grep 'install' /var/log/dpkg.log &gt;&gt; ~/irFiles.txt")
  
  file1 = '~/irFiles.txt'
  </code></pre>
  
  <p>But I haven't been able to figure out how to set up the for loop yet.
  Thanks!</p>