Q:

R: read table with multiple separators and parantheses?

I have received this type of table, available also here

I wonder, how to efficiently open the table in R?
My output should be splitted in 3 separate columns, and without the parentheses: :
      id   type  V1  
1 13242924 'SA'  1 
2 13035909 'SA'  1 
3 6685553  'SA'  1 
4 12990163 'SA'  1  

For now, I was thinking to split it in few steps:

open the file as .csv with \t separator, 
use multiple gsub() to replace both parentheses, 
split the first column in two, etc. 

Isn't there a simpler way? Also, seems that optim$V1 <- gsub('(', "", optim$V1) simply does not remove parantheses.
df<- read.csv("C:/sample.csv",
               sep =  "\t",
               header = F)

# Replace the parantheses:
optim$V1 <- gsub('(', "", optim$V1)

A:

One way would be to read it in using readLines(), clean it up and then read it in again with read.table().
txt <-  readLines("C:/sample.csv")

read.table(text = gsub("[()\",\t]", " ", txt))

        V1 V2 V3
1 13242924 SA  1
2 13035909 SA  1
3  6685553 SA  1
4 12990163 SA  1
5 13243126 SA  1
6 12941091 SA  1
7 12939233 SA  1
8 13242835 SA  1
9  6685130 SA  1

