title: How do I extract the value from a particular cell across hundreds of .csv files?
body: <p>I have approximately 400 <code>.csv</code> files and need to take just one value from each of them (cell <code>B2</code> if opened using spreadsheet software).</p>
  
  <p>Each file is an extract from a single date and is named accordingly (i.e. <code>extract_2017-11-01.csv</code>, <code>extract_2018-04-05</code>, etc.)</p>
  
  <p>I know that I can do something like this to iterate over the files (correct me if I am wrong, or if there is a better way please do tell me):</p>
  
  <pre><code>path &lt;- "~/csv_files"
  
  out.file &lt;- ""
  
  file.names &lt;- dir(path, pattern =".csv")
  
  for(i in 1:length(file.names)){
    file &lt;- read.table(file.names[i], header = TRUE, sep = ",")
    out.file &lt;- rbind(out.file, file)
  }
  </code></pre>
  
  <p>I want to effectively add something at the end of this which creates a data frame consisting of two columns: the first column will show the date (this ideally would be taken from the filename) and the second column will hold the value in cell <code>B2</code>.</p>
  
  <p>How can I do this?</p>