sorry ,maked an mistake.
actually,the data size is 805 vars, 118519 obs.

2006/1/5, ronggui wong <[EMAIL PROTECTED]>:
> Thanks to all give response to help.
> This is my solution using the luanguage I familiar.(http://www.r-project.org).
>
> I use the code to read a 11819x807 csv file and it takes 10 minus.I think is
> not too slow .(My PC:1.7G,512M RAM)
>
> #code begins
> rm(list=ls())
> f<-file("D:\\wvsevs_sb_v4.csv","r")#134M
> i <- 0
> done <- FALSE
> library(RSQLite)
> con<-dbConnect("SQLite","c:\\sqlite\\database.db3")
> tim1<-Sys.time()
>
> while(!done){
> i<-i+1
> tt<-readLines(f,2500)
> if (length(tt)<2500) done <- TRUE
> tt<-textConnection(tt)
> if (i==1) {
>         assign("dat",read.table(tt,head=T,sep=",",quote=""));
>          # to make the variable names elegent
>          nam<-names(dat);
>          nam<-gsub("^X.","",nam);
>          nam<-tolower(gsub(".$","",nam))
>     names(dat)<-nam
>         #
> }
> else assign("dat",read.table(tt,head=F,sep=",",quote=""))
> close(tt)
> ifelse(dbExistsTable(con, "wvs"),dbWriteTable(con,"wvs",dat,append=T),
>  dbWriteTable(con,"wvs",dat) )
> }
> close(f)
> #cal the time require
> Sys.time()-tim1
>
> #code end.
>

Reply via email to