I would like to use R to go into a text document I have and iteratively substitute the base name of the files in the first two lines (input and output) with those from a list I have stored in R. The text file looks like this:
parameter input "C:\Users\inputdirectory\20090522_104644_r2_0_DVJ_50.k"
parameter output "C:\Users\outputdirectory\20090522_104644_r2_0_DVJ_50.k"
parameter meshsize 60.0
parameter zlength 500.0
parameter zelem 10
runscript "meshoutline.scl" &input &output &meshsize &zlength &zelem
The idea is to replace the input and output files (they should be identical names since they are stored in different directories) and then send the script to run in CMD. Then repeat the loop with the next file name in the list, which looks like this in R:
flist <- c("20080715_160601_es_2_KOE_50", "20080806_162049_es_0_JSX_50", "20080810_004229_es_0_WIB_50")
I've never used R for systems stuff before. Is this possible?