title: Using Awk Commands in R to Extract Data
body: <p>This question is a continuation and clarification of this question, <a href="https://stackoverflow.com/questions/14261776/extracting-data-from-text-files">Extracting Data from Text Files</a> I shut this question down but I'm still having difficulty applying the answers to my problem.</p>
  
  <p>I'm sat at a Windows machine and I'm using Putty to submit jobs to a supercomputer.  The jobs return files of the following format, <a href="http://www.d.umn.edu/~psiders/courses/chem4642/quantumchemsoftware/tutorial/gamess/methanol.out" rel="nofollow noreferrer">http://www.d.umn.edu/~psiders/courses/chem4642/quantumchemsoftware/tutorial/gamess/methanol.out</a>.  (Note that this is a .log file rather than a .out file which is important for reading what follows).</p>
  
  <p>I interrogate the files using the following shell commands,</p>
  
  <pre><code>grep MAXIMUM FileName.log | awk '{print $4}'
  </code></pre>
  
  <p>which returns a series of numbers that I copy to my clipboard and then run the following R file, </p>
  
  <pre><code>MAX1 &lt;- readClipboard(format=1, raw=FALSE) # reading data
  plot(MAX1, type="b", ylim=c(0,0.00005), xlim=c(0,50), 
  main=bquote(After~ .(length(MAX1))~ iterations))
  abline(h=0.00001, col="red")
  </code></pre>
  
  <p>which returns a graphical representation of the calculation.</p>
  
  <p>(Other people do this with perl scripts).</p>
  
  <p>When the calculation is complete I extract the file from the supercomputer and store it on my windows system.</p>
  
  <p>What I want to do is to prepare an R script that can interrogate the .log file within a windows environment.</p>
  
  <p>I know how to change the directory, list the files and use readLines to get the file into R,</p>
  
  <pre><code>grep("MAXIMUM",readLines("FileName.log"), value=TRUE) #searching files
  </code></pre>
  
  <p>but this doesn't return the values as a string of numbers that I can put into plot.  It looks like character strings without 'awk' being applied to them.  </p>
  
  <p>Can anyone help me iron out this last bit?</p>