Skip to content
Snippets Groups Projects
Commit 1d15b920 authored by Thomas  OBADIA's avatar Thomas OBADIA :speech_balloon:
Browse files

Add a step to both 01_INVENTORY and 02_OBSERVATIONAL database dumping scripts...

Add a step to both 01_INVENTORY and 02_OBSERVATIONAL database dumping scripts to write the raw output to an external file.
parent 3fca6288
No related branches found
No related tags found
No related merge requests found
...@@ -135,6 +135,31 @@ if (!DATA_EXTRACT_IS_RECENT) { ...@@ -135,6 +135,31 @@ if (!DATA_EXTRACT_IS_RECENT) {
######################################################################
### WRITE RAW DATA TO OUTPUT DIRECTORY
######################################################################
## Name of output file
INVENTORY_OUT_01_FILENAME <- paste0("INVENTORY_OUT_01_raw_data",
"_country-",
paste(unique(dat_inventory_raw$country), collapse = "-"),
"_timestamp-",
strftime(Sys.time(), format = "%Y%m%d_%H%M%S"),
".csv")
## Write to output file
write.table(dat_inventory_raw,
file = paste0("./01_INVENTORY/outputs/",
INVENTORY_OUT_01_FILENAME),
sep = ",",
dec = ".",
quote = TRUE,
col.names = TRUE,
row.names = FALSE)
###################################################################### ######################################################################
### UPDATE DATA_EXTRACT_IS_RECENT ### UPDATE DATA_EXTRACT_IS_RECENT
###################################################################### ######################################################################
......
...@@ -107,6 +107,31 @@ if (!DATA_EXTRACT_IS_RECENT) { ...@@ -107,6 +107,31 @@ if (!DATA_EXTRACT_IS_RECENT) {
######################################################################
### WRITE RAW DATA TO OUTPUT DIRECTORY
######################################################################
## Name of output file
OBSERVATIONAL_OUT_01_FILENAME <- paste0("OBSERVATIONAL_OUT_01_raw_data",
"_country-",
paste(unique(dat_observational_raw$country), collapse = "-"),
"_timestamp-",
strftime(Sys.time(), format = "%Y%m%d_%H%M%S"),
".csv")
## Write to output file
write.table(dat_observational_raw,
file = paste0("./02_OBSERVATIONAL/outputs/",
OBSERVATIONAL_OUT_01_FILENAME),
sep = ",",
dec = ".",
quote = TRUE,
col.names = TRUE,
row.names = FALSE)
###################################################################### ######################################################################
### UPDATE DATA_EXTRACT_IS_RECENT ### UPDATE DATA_EXTRACT_IS_RECENT
###################################################################### ######################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment