I have many large tables for which the starting cell may contain multiple quotes, like this:
test.txt-
"abc"" xyz""",123
mno,456
Now fread("test.txt",sep=",",header=F)
throws up an error
Error in fread("123.txt", sep = ",", header = F) :
Unexpected character (" nxy) ending field 1 of line 1
It reads this test2.txt-
qwe,999
"abc"" nxyz""",123
mno,456
with fread("test2.txt",sep=",",header=F)
properly though.
I need to make it run the other way though. Any solutions?
@Arun, I tried installing data.table v1.9.3 from github but got the following error, any ideas? Thanks.
> remove.packages("data.table")
Removing package from ‘C:/Users/sidpat/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
> install_github("Rdatatable/data.table")
Installing github repo data.table/master from Rdatatable
Downloading master.zip from https://github.com/Rdatatable/data.table/archive/master.zip
Installing package from C:\Users\SIDPAT\AppData\Local\Temp\RtmpUBzt2K/master.zip
Installing data.table
"C:/PROGRA~1/R/R-30~1.3/bin/x64/R" --vanilla CMD build \
"C:\Users\sidpat\AppData\Local\Temp\RtmpUBzt2K\devtoolsc241bb5e2e\data.table-master" \
--no-manual --no-resave-data
* checking for file 'C:\Users\sidpat\AppData\Local\Temp\RtmpUBzt2K\devtoolsc241bb5e2e\data.table-master/DESCRIPTION' ... OK
* preparing 'data.table':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* installing the package to build vignettes
Warning: running command '"C:/PROGRA~1/R/R-30~1.3/bin/x64/Rcmd.exe" INSTALL -l "C:\Users\SIDPAT\AppData\Local\Temp\RtmpKyohpy\Rinst1ee42c4a1653" --no-multiarch "C:/Users/sidpat/AppData/Local/Temp/RtmpKyohpy/Rbuild1ee425057481/data.table"' had status 1
-----------------------------------
* installing *source* package 'data.table' ...
** libs
Warning: running command 'make -f "Makevars" -f "C:/PROGRA~1/R/R-30~1.3/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-30~1.3/share/make/winshlib.mk" SHLIB="data.table.dll" WIN=64 TCLBIN=64 OBJECTS="assign.o bmerge.o chmatch.o dogroups.o fastmean.o fastradixdouble.o fastradixint.o fcast.o fmelt.o forder.o frank.o fread.o gsumm.o ijoin.o init.o rbindlist.o reorder.o uniqlist.o vecseq.o wrappers.o"' had status 127
ERROR: compilation failed for package 'data.table'
* removing 'C:/Users/SIDPAT/AppData/Local/Temp/RtmpKyohpy/Rinst1ee42c4a1653/data.table'
-----------------------------------
ERROR: package installation failed
Error: Command failed (1)