Hi Jim,
Thanks,Jim. I couldn't get fread to work either for this.
I ended up with this:
txt<- readLines('test_fread.dat');
data.frame1 <- read.table(text=txt, sep='', header=FALSE,
skip=grep('*END*', txt))
BTW, i use that Map Rose function you wrote a few years back quite often.
Thanks for the
Hi Trevor,
I couldn't work out how to do it with just fread, but perhaps this will help:
# create a test file
sink("test_fread.dat")
cat("This is the header of a file\n")
cat("that ends with the word *end*\n")
cat("Col1 Col2\n1 2\n3 4\n5 6\n")
sink()
# try to read it
test_con<-file("test_fread.dat
I'm trying to read in a file using the function fread.
The file that I'm trying to read in has about 100 lines of information I
don't want prior to getting to my matrix of data that I do want. On the
line prior to the data I want there is always a string identifier "*end*"
The following fread ca
3 matches
Mail list logo