belege umbenannt

This commit is contained in:
2026-04-30 17:40:13 +02:00
parent f52d5fa3dd
commit b5d7e435c1
802 changed files with 84 additions and 19296 deletions
+25 -1
View File
@@ -450,7 +450,7 @@ if(ok){
anz <- length(eintraege)
for(ind in 1:length(eintraege)){
if( exists(paste0(zielpfad, eintraege[ind])) ){
cat(ind, " von ", anz, "\n")
cat(ind, " von ", anz, "\n")
file.copy(
from = paste0(pfad, vorhanden[ind]),
to = "~/Documents/workspace/gemfin-shiny/www/documents/")
@@ -498,3 +498,27 @@ dbDisconnect(con_f)
print("Migration finished.")
## * Dateien umbenennen ----
library("tools")
atts <- dbReadTable(conn, "attachments")
sum(duplicated(atts$id)) == 0
pfad <- "www/attachments/"
for( ind in 1:nrow(atts)){
datei <- atts$original_name[ind]
if( file.exists(paste0(pfad, datei)) ){
# print(ind)
ext <- file_ext(datei)
idwert <- atts$id[ind]
if(is.na(idwert)) break
name_neu <- paste0(idwert,".",ext)
print(name_neu)
file.copy(from = paste0(pfad, datei), to=paste0("www/documents/", name_neu), overwrite = T)
}
}
atts %>%
filter(id == 1379)
which( "1379.pdf" %in% atts$original_name)