check this! if it helps! read_data <- read.csv(DataMatrix) length <- dim(read_data)[1] no_of_files <- 10 ##user define file_no_itr <- length/no_of_files
for(i in 1:no_of_files){ e_l <- i*file_no_itr s_l <- 1 + (i-1)* file_no_itr if(i==no_of_files){ e_l <- length} read_data_new <- read_data[s_l:e_l,] newname <- paste("read_data",i,sep="_") assign(read_data_new,newname) ### write ur output data code } ----- Bharat Warule Cypress Analytica , Pune -- View this message in context: http://r.789695.n4.nabble.com/Split-CSV-as-per-file-size-tp4639880p4639883.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.