diff --git a/04_find_and_replace_uri.R b/04_find_and_replace_uri.R index cb9c778..d7f399b 100644 --- a/04_find_and_replace_uri.R +++ b/04_find_and_replace_uri.R @@ -22,7 +22,7 @@ to_replace_done <- to_replace_original for (spalte_excel in SPALTEN[1]:SPALTEN[length(SPALTEN)]) { #Start der Zeitmessung für aktuelle Spalte - tic(paste("starte mit Spalte",spalte_excel)) + tic(paste("starte mit Spalte", spalte_excel)) #Zweite Schleife über die jeweiligen Zeilen des Spaltenvektors for (zeile_excel in 1:nrow(to_replace_original[, spalte_excel])) { @@ -60,7 +60,6 @@ for (spalte_excel in SPALTEN[1]:SPALTEN[length(SPALTEN)]) { #Legt eine Liste aus Zahlen zwischen 1900 & 2099 an, die in der aktuellen Zelle sind. (soll das Jahr der Publizierung finden) db_search_numbers <- unlist(str_extract_all(current_db, "(?:19|20)\\d{2}")) - #Initialiersierung der Countvariablen count_all <- 0 count_numbers <- 0 @@ -100,6 +99,7 @@ for (spalte_excel in SPALTEN[1]:SPALTEN[length(SPALTEN)]) { #Beim Jahr muss die Übereinstimmung höher sein, weil es ein sehr guter Indikator für die gleiche Publikation ist if ((percent_match_all >= MATCH_ALL) && (percent_match_numbers > MATCH_YEAR)) { + #in der DB sind die uris mit <...> um die uri selbst, diese müssen entfernt werden, zusätzlich nochmals eventuell anfallende Leerzeichen to_replace_done[zeile_excel, spalte_excel] <- str_squish(str_remove_all(inDB[zeile_db,ID], "[<>]")) } @@ -111,5 +111,4 @@ for (spalte_excel in SPALTEN[1]:SPALTEN[length(SPALTEN)]) { #Schreibt die Exceldatei ins Outputverzeichnis 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) - +write_xlsx(to_replace_done, pfad_output) \ No newline at end of file