I have a dsv file with the custom delimiter |
. I can easily read this into Stata by using the GUI to select a custom delimiter, but all the variants of read.csv
that I've tried in R haven't worked.
Does anyone know how to how to import a dsv file into R with a custom delimiter?
You can use: read.table(filename,sep="|",header=TRUE)
. Given the file sample.csv
with contents:
a|b|c
1|2|3
The output looks like:
read.table("sample.csv",sep='|',header=TRUE)
a b c
1 1 2 3