Uwe Ligges wrote: > > > Marie Sivertsen wrote: >> Dear list, >> >> Is there any functionality in R that would allow me to parse config >> files? > > Which kind of config files? R has read.dcf, for example. >
indeed, there are quite a number of more or less unambiguously specified configuration file formats. for the lack of an existing solution (or, more likely, due to my ignorance) i've crufted together a trivial script that parses simple ini-like config files, with square-bracketed section headers, like this: [foo] bar = BAR [bar] foo = ... you just source the script, specify the config file, and get a nested list of config parameters, e.g. source('http://miscell.googlecode.com/svn/rconfig/rconfig.r') config = rconfig('somefile.cfg') config$foo$bar # "BAR" the functionality is rudimentary and not fool-proof, no string-to-number parsing, no comment skipping, etc. i'm not really suggesting it as a solution to your (underspecified) problem, feel free to modify/extend it to match your needs. vQ ______________________________________________ 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.