Recently, in version 2.4-0 nops_eval()
gained the option to plug in custom writers for the evaluation results. So, in principle, this could be used. However, if the focus is just to rename the HTML files, I would probably simply unzip()
the ZIP file, file.rename()
the HTML files, and then file.remove()
the previous directories.
For me on Linux this works:
f <- unzip("nops_eval.zip")
id <- strsplit(f, "/", fixed = TRUE)
id <- sapply(id, function(x) x[length(x) - 1])
for(i in seq_along(id)) {
file.rename(f[i], paste0(id[i], ".html"))
file.remove(id[i])
}
Note: Possibly, the file paths in f
are separated with a backslash rather than a slash on Windows. If so, you would have to replace "/"
with "\"
in the strsplit()
call.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…