Hi here i have a code to split a csv file as per group of line.

The code given below,
------------------------------------
SplitCSVByLine <- function(DataMatrix,Destination,NoOfLineToGroup)
{ 
     input <- file(DataMatrix, "r") 
     fileNo <- 1
     repeat
        {
                     myLines <- readLines(input, n=NoOfLineToGroup)
                     if (length(myLines) == 0) break
                writeLines(myLines, 
sprintf(paste(Destination,"Split_File_%05d.csv"),
fileNo))
                fileNo <- fileNo + 1
        }
     close(input)
}
---------------------------------------
But how can we split a csv file into number of other csv files as per
size(in kilo byte) ?
I tried for it manytimes  .
Can any one help me ?

- Thanks in advance
Antony.




--
View this message in context: 
http://r.789695.n4.nabble.com/Split-CSV-as-per-file-size-tp4639880.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to