I have a list of files (not made by me) that for some reason are all labelled (".csv") even though some are csv and some are tab delimited. So when I try read them in R, I would have to specify separator manually. Unless, someone knows if there is a way to check this before I get a mangled file read in.
Should have put this in an answer...
The fread
function in the package data.table makes an attempt to guess the correct separator. It's probably not perfect, but it will likely handle most simple cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With