
setwd("C:/Users/victor/Documents/TFG/r-analytics-master")
source("add_missing_values.R")

list_of_files <- list.files("C:/Users/victor/Documents/TFG/r-analytics-master/ressources/current_db")[-6]

#ist_of_files <- "Harmonized_LIH.csv"

for (i in 1:length(list_of_files)) {
  
  file_name <- list_of_files[i]
  
  print(paste ("Fixing file:", file_name))
  
  setwd("C:/Users/victor/Documents/TFG/r-analytics-master/ressources/current_db")
  
  ready_file <- add_missing_values(file_name)
  
  setwd("C:/Users/victor/Documents/TFG/r-analytics-master/ressources/current_db/ready")
  
  write.csv(x=ready_file, file = file_name, row.names = FALSE)
  
}
