Config file and change of folder structure

This commit is contained in:
Linsberger Christian 2021-09-06 11:12:20 +02:00
commit bc9e2d06ac
4 changed files with 27 additions and 27 deletions

19
config/config.R Normal file
View file

@ -0,0 +1,19 @@
###### Konfiguration für das Projekt ######
#Pfade
PFAD_EXCEL <- "data/Input/"
PFAD_OUT <- "data/Output/"
PFAD_DB_OUT <- "data/Database/"
#Datei in der ersetzt werden soll
FILENAME_EXCEL <- "GC3D_Limits_ref.xlsx"
#Spaltennummer in denen ersetzt werden soll im Excel
SPALTEN <- c(2, 3, 4, 5, 6)
#Spaltennummer mit der verglichen wird aus Datenbank (citations)
INHALTE_DB <- 3
#Spaltennummer der Inhalte die eingesetzt werden soll (uris)
ID <- 1

View file

@ -8,30 +8,9 @@ library("stringr")
library("tictoc")
library("rlang")
source("../sparql.R")
###### Konfiguration #########
#Arbeitsverzeichnis
setwd("C:/Users/linchr/ownCloud/GIT/URI_Replacement")
#Funktionen einbinden
source("sparql.R")
#Datei in der ersetzt werden soll
FILENAME_EXCEL <- "GC3D_Limits_ref.xlsx"
PFAD_EXCEL <- "data/"
#Spaltennummer in denen ersetzt werden soll im Excel
SPALTEN <- c(2, 3, 4, 5, 6)
#Spaltennummer mit der verglichen wird aus Datenbank (citations)
INHALTE_DB <- 3
#Spaltennummer der Inhalte die eingesetzt werden soll (uris)
ID <- 1
##############################
source("config/config.R")
### Einlesen ###
@ -43,7 +22,6 @@ to_replace_done <- to_replace_original
###
#Schleife über den Spaltenvektor aus der Excel
for (spalte_excel in SPALTEN[1]:SPALTEN[length(SPALTEN)]) {
@ -112,6 +90,6 @@ for (spalte_excel in SPALTEN[1]:SPALTEN[length(SPALTEN)]) {
toc()
pfad_output <- paste(PFAD_EXCEL, "replaced_" , FILENAME_EXCEL, sep="")
pfad_output <- paste(PFAD_OUT, "replaced_", format(Sys.time(), "%Y_%m_%d_%H%M%S"), FILENAME_EXCEL, sep="")
write_xlsx(to_replace_done, pfad_output)

View file

@ -3,7 +3,7 @@ library("writexl")
library("tidyverse")
library("xlsx")
setwd("C:/Users/linchr/ownCloud/GIT/URI_Replacement")
pfad <- "data/Input/"

View file

@ -1,6 +1,9 @@
library("SPARQL")
library("stringi")
### Konfiguration einbinden
source("config/config.R")
### Gets the bibliographicCitations which are currently in the db ##################
read_current_geoera_lit_db <- function() {
@ -32,7 +35,7 @@ for (j in 1:length (inDB[1, ])) {
}
pfad <- paste("data/inDB-", format(Sys.Date(), "%Y_%m_%d"), ".xlsx", sep="")
pfad <- paste(PFAD_DB_OUT, "inDB-", format(Sys.Date(), "%Y_%m_%d"), ".xlsx", sep="")
write_xlsx(inDB, pfad)
@ -41,7 +44,7 @@ write_xlsx(inDB, pfad)
get_current_geoera_lit_db <- function() {
pfad <- paste("data/inDB-", format(Sys.Date(), "%Y_%m_%d"), ".xlsx", sep="")
pfad <- paste(PFAD_DB_OUT, "inDB-", format(Sys.Date(), "%Y_%m_%d"), ".xlsx", sep="")
if (file.exists(pfad)) {
inDB <- read_excel(pfad)