title: Reading and Writing .TSV files in R
body: <p>I have to do some analysis on a .tsv file for a project, and I am fairly new to R. I am having a problem when reading/writing a .tsv file in R. It seems like problem occurs when there is a quote ("") in the row. </p>
  
  <p>Example of a few records in the original file are below:</p>
  
  <pre><code>org_id    org_name        description                    created at     
  5762      Artifice        Artifice \comes from Latin     4/3/2014 19:42
  1045      Access Dar      Microsoft "Nasdaq worldwide    7/4/2014 10:34
  345       Living Asset    Lincoln Park Zoo               11/3/2014 19:42
  2356      Adler Planet    Mission of black cat           12/2/2014 11:03
  </code></pre>
  
  <p>I am reading the file with the following code line:</p>
  
  <pre><code>orgs &lt;- read.delim("C:/Users/orgs.tsv", header=TRUE)
  </code></pre>
  
  <p>After renaming the columns, I write the file using the code below:</p>
  
  <pre><code>write.table(orgs, file = "C:/Users/orgs_updated.tsv", row.names=FALSE, sep="\t")
  </code></pre>
  
  <p>Now when I try to read this file (orgs_updated.tsv) in another program, it does not like when there are quotes in any of the columns. I am reading the file again using the code below:</p>
  
  <pre><code>orgs_updated &lt;- read.delim("C:/Users/orgs_updated.tsv", sep="", header=TRUE, quote="\"")
  </code></pre>
  
  <p>and the file is being read like this, i.e. being read wrong, and adding a wrong row.</p>
  
  <pre><code>org_id    name        description                    created at     
  5762      Artifice        Artifice \comes from Latin     4/3/2014 19:42
  1045      Access Dar      Microsoft                      Nasdaq worldwide    
  7/4/2014 10:34
  345       Living Asset    Lincoln Park Zoo               11/3/2014 19:42
  2356      Adler Planet    Mission of black cat           12/2/2014 11:03
  </code></pre>
  
  <p>I am not sure what am I doing wrong. I tried:</p>
  
  <pre><code>using the quote=FALSE option in write.table, 
  not using quote option in the 2nd read.delim
  changing sep = "" to sep ="\t"
  </code></pre>
  
  <p>but was not able to figure out the solution.</p>
  
  <p>I will appreciate if someone can please help!!</p>