Re: [R] Text file: multiple matrix

2012-10-10 Thread Purna chander
Hi, You can try this and see. I'm assuming that the initial text file named "test.txt". x<-read.table("test.txt",header=T) # if headers are present in "test.txt" or x<-read.table("test.txt") # Actually, read.table() command skips the blank lines. n<-256 for (i in 1:100){ filename=past

Re: [R] Text file: multiple matrix

2012-10-09 Thread Rui Barradas
Hello, Try the following, substituting your filename for "test.txt". fun <- function(filenumber, con, n, sep = " ", prefix = "RTest"){ txt <- readLines(con, n = n) tc <- textConnection(txt) on.exit(close(tc)) tbl <- read.table(tc, sep = sep)[-n, ] filename <- sprintf("%s_%03