用R進行批量文件的重命名

需求:books文件夾下有xxx.001.zip格式的文件須要去掉.zip後綴 實現: folder <- "c:/books"files <- list.files(folder)for(f in files){ newname <- sub('\\.zip','',f) file.rename(paste0(folder,'/',f),paste0(folder,'/',newname))
相關文章
相關標籤/搜索