|
@@ -0,0 +1,40 @@
|
|
|
+library (googlesheets4)
|
|
|
+gs_auth()
|
|
|
+#
|
|
|
+template_f = gs_url ("https://docs.google.com/spreadsheets/d/1rrl2QcBIQNIQ-D5ugH7FuaiVckItAQxRVlW-Jgb9sdo/edit?ts=5ee10875#gid=1035048464")
|
|
|
+
|
|
|
+#
|
|
|
+# data= googlesheets::gs_read_csv(PIlist, skip =2)
|
|
|
+
|
|
|
+template_data <- read_sheet("https://docs.google.com/spreadsheets/d/1rrl2QcBIQNIQ-D5ugH7FuaiVckItAQxRVlW-Jgb9sdo/edit?ts=5ee10875#gid=1035048464")
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+createtemplate <- function(dirname ="template1", template_data) {
|
|
|
+ dir.create(dirname)
|
|
|
+ setwd(dirname)
|
|
|
+ template_dataf = template_data [(template_data$create != "NULL"),]
|
|
|
+ for (i in c(nrow(template_dataf):1)){
|
|
|
+ if (nchar(template_dataf$create[i])<2) {
|
|
|
+ dir.create(template_dataf$alternative_name[i])
|
|
|
+ file.create(paste0(template_dataf$alternative_name[i], "/gitdir"))
|
|
|
+ file.rename(template_dataf$alternative_name[i], paste0 ("0",template_dataf$create[i],"_",template_dataf$alternative_name[i]))
|
|
|
+ } else {
|
|
|
+ dir.create(paste0(template_dataf$create[i], "/",template_dataf$alternative_name[i]), recursive = TRUE)
|
|
|
+ file.create(paste0(template_dataf$create[i], "/",template_dataf$alternative_name[i], "/gitdir"))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ setwd("../")
|
|
|
+}
|
|
|
+
|
|
|
+#setwd("20_deriveddata")
|
|
|
+template_data$create = as.character(template_data$upfolder_2)
|
|
|
+createtemplate(dirname ="template1",template_data)
|
|
|
+
|
|
|
+template_data$create = as.character(template_data$unitial_upfolder)
|
|
|
+createtemplate(dirname ="template_ori",template_data)
|
|
|
+template_data$create = as.character(template_data$upfolder_3)
|
|
|
+createtemplate(dirname ="template_3",template_data)
|
|
|
+
|