title: Removing "NUL" characters (within R)
body: <p>I've got a strange text file with a bunch of <code>NUL</code> characters in it (actually about 10 such files), and I'd like to programmatically replace them from within R. <a href="https://www.dropbox.com/s/9qqyj91b47l04m3/test_nul.dat." rel="nofollow noreferrer">Here</a> is a link to one of the files.
  With the aid of <a href="https://stackoverflow.com/questions/19332949/removing-nul-characters">this</a> question I've finally figured out a better-than-<em>ad-hoc</em>  way of going into each file and find-and-replacing the nuisance characters. It turns out that each pair of them should correspond to one space (<code>[NUL][NUL]</code>-><code></code>) to maintain the intended line width of the file (which is crucial for reading these as fixed-width further down the road).</p>
  
  <p>However, for robustness' sake, I prefer a more automable approach to the solution, ideally (for organization's sake) something I could add at the beginning of an R script I'm writing to clean up the files. <a href="https://stackoverflow.com/questions/28979857/is-there-a-sed-type-package-in-r-for-removing-embedded-nuls">This</a> question looked promising but the accepted answer is insufficient - <code>readLines</code> throws an error whenever I try to use it on these files (unless I activate <code>skipNul</code>).</p>
  
  <p>Is there any way to get the lines of this file into R so I could use <code>gsub</code> or whatever else to fix this issue without resorting to external programs?</p>