title: How to save R output data to a text file
body: <p>Hope your doing well.</p>
  <p>My question might have answered by someone else but as I couldn't able to find related answer so I'm writing a post here.</p>
  <h1>Question</h1>
  <p>How to save R output to a text file.</p>
  <p>I've extracted data from scanned PDF using R but my out put is in console and I want to save that as a text file. If you have any suggestions please let me know.</p>
  <p>My code as follows</p>
  <pre><code>library (tesseract)
  filename= 'my_file.pdf'
  file &lt;- pdftools::pdf_convert(filename, dpi =600)
  text&lt;- tesseract::ocr(file)
  Cat(text)
  </code></pre>
  <p>How to save cat(text) to a text file</p>
  <p>Thanks </p>
  <h1>how to split below data any idea</h1>
  <pre><code>  Xxxx xxxx xxxx xxxx x [2 XXXX $123.45 10.1000 $10.20
  </code></pre>
  <p>First split has to be [2 and then spaces there after</p>