setwd("C:/GenSoftware/Colony/datFiles")
listofFile = list.files()
Records <- as.data.frame(listofFile)
count <- nrow(Records)
x = 1:count
for(i in seq(along=x))
{
file.rename(listofFile[i],"Colony2.DAT")
file.copy(from = "C:/GenSoftware/Colony/datFiles/Colony2.DAT",to = "C:/GenSoftware/Colony/")
datPath <- "C:/GenSoftware/Colony/Colony2.DAT"
setwd("C:/GenSoftware/Colony/")
run.colony(colonyexecpath = "Colony2.exe", datPath, wait = FALSE, monitor = TRUE)
setwd("C:/GenSoftware/Colony/datFiles/")
file.rename("Colony2.DAT",dat)
}
sorry didn't have time to test because I'm running some intensive stuff on my machine.
This will definitely show you it the process iterate through the directory of files
setwd("C:/GenSoftware/Colony/datFiles")
listofFile = list.files()
Records <- as.data.frame(listofFile)
count <- nrow(Records)
x = 1:count
for(i in seq(along=x))
{
print(listofFile[i])
}