Answers.Body: <p>Delete the corrupt portion preceeding <code>CFS</code> in the header and it works with with <code>read.delim()</code>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-08T11:58:25.247Z
Answers.Text: Sorry where is the corrupt portion preceeding CFS ?
Answers.UserDisplayName: Zizogolu
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-08T11:59:04.287Z
Answers.Text: Everything before it. Just open it in a text editor.
Answers.UserDisplayName: Devon Ryan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-08T12:39:11.970Z
Answers.Text: @DevonRyan Couldn't it be a different encoding used?
Answers.UserDisplayName: llrs
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-08T12:43:16.100Z
Answers.Text: @llrs No, there was just a bunch of gibberish. It looks like some other content got added to the front of the file.
Answers.UserDisplayName: Devon Ryan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-08T12:51:49.350Z
Answers.Text: Ok, it's simply when I see this question marks I always suspect of wrong encoding...
Answers.UserDisplayName: llrs
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-08T11:55:09.410Z
Answers.LastActivityDate: 2019-05-08T11:55:09.410Z
Answers.UserDisplayName: Devon Ryan
Answers.Body: <p>We can skip the first row:</p>
  
  <pre><code>read.delim("txt.txt", skip = 1, header = FALSE)
  </code></pre>
  
  <p><strong>Or</strong> we can get the <em>"uncorrupted"</em> version of the table, it looks like it is from <a href="https://doi.org/10.1016/j.celrep.2013.07.003" rel="nofollow noreferrer">this paper</a>, <a href="https://www.sciencedirect.com/science/article/pii/S2211124713003501?via%3Dihub#mmc4" rel="nofollow noreferrer">Table S4</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-08T20:20:45.290Z
Answers.LastActivityDate: 2019-05-08T20:20:45.290Z
Answers.UserDisplayName: zx8754
Body: <p>I am trying to read a txt file in R but always I am getting </p>
  
  <pre><code>Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  : 
    line 113 did not have 10 elements
  </code></pre>
  
  <p>I noticed that in the header of my file I have something like </p>
  
  <pre><code> 0000775 €   g¿´�€   4_®™00000016125 13404727020 017402  0                                                                                                    ustar   devons01                        stlab-icgc 
  </code></pre>
  
  <p>Even by removing these characters I am not able to read this file</p>
  
  <p>This is link of my file</p>
  
  <p><a href="https://www.dropbox.com/s/rpc5jgti5aa433b/txt.txt?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/rpc5jgti5aa433b/txt.txt?dl=0</a></p>
  
  <p>Could somebody please heap me in reading this file in R?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-08T20:21:57.523Z
Comments.Text: Where is the file from, how was it generated? Looks like an [XY Problem](https://en.wikipedia.org/wiki/XY_problem).
Comments.UserDisplayName: zx8754
Tags: <r>
Title: Reading a txt in R with weird header
ThreadText: # Reading a txt in R with weird header
  
  (Asked by: username_0 on 2019-05-08)
  
  I am trying to read a txt file in R but always I am getting
  
  ```
  Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  : 
    line 113 did not have 10 elements
  
  ```
  
  I noticed that in the header of my file I have something like
  
  ```
   0000775 €   g¿´�€   4_®™00000016125 13404727020 017402  0                                                                                                    ustar   devons01                        stlab-icgc 
  
  ```
  
  Even by removing these characters I am not able to read this file
  
  This is link of my file
  
  <https://www.dropbox.com/s/rpc5jgti5aa433b/txt.txt?dl=0>
  
  Could somebody please heap me in reading this file in R?
  
  **Tags:** r
  
  > **Comments:**
  > **username_1**: Where is the file from, how was it generated? Looks like an [XY Problem](https://en.wikipedia.org/wiki/XY_problem).  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-05-08. Score: 2 | Accepted answer
  
  Delete the corrupt portion preceeding `CFS` in the header and it works with with `read.delim()`.
  
  > **Comments:**
  > **username_0**: Sorry where is the corrupt portion preceeding CFS ?  
  > **username_2**: Everything before it. Just open it in a text editor.  
  > **username_3**: @username_2 Couldn't it be a different encoding used?  
  > **username_2**: @username_3 No, there was just a bunch of gibberish. It looks like some other content got added to the front of the file.  
  > **username_3**: Ok, it's simply when I see this question marks I always suspect of wrong encoding...  
  
  ---
  
  ### Answer by username_1 on 2019-05-08. Score: 3
  
  We can skip the first row:
  
  ```
  read.delim("txt.txt", skip = 1, header = FALSE)
  
  ```
  
  **Or** we can get the *"uncorrupted"* version of the table, it looks like it is from [this paper](https://doi.org/10.1016/j.celrep.2013.07.003), [Table S4](https://www.sciencedirect.com/science/article/pii/S2211124713003501?via%3Dihub#mmc4).
  
  
  ---
  
  