Export CSV cell content to .txt, with content as file name (R)
<p>I want to export the content of every cell in a column to an individual .txt file with the content of the cell also passed as the filename for the .txt file. I have this script in R below, but for some reason the loop <code>i in 1:length()</code> only works for columns, i.e. Column A:Z, but not the rows A1:A26. </p>

<p>Any help to get this script to export the contents of the rows A1:A26 would be appreciated!</p>

<p>Context: This is for creating a MALLET corpus from unstructured text in CSVs for natural language processing.</p>

<pre><code>filenames &lt;- names(NLPL)
for (i in 1:length(NLPL)){
  outname &lt;- paste("", filenames[i], ".txt", sep= "")
  write.table(NLPL[[i]], outname, col.names= F, row.names= F, quote= F)
}
</code></pre>