Skip to content

Commit

Permalink
Removing periods from created folder elements (hopefully fixes weird …
Browse files Browse the repository at this point in the history
…Windows issue)
  • Loading branch information
njlyon0 committed Apr 11, 2024
1 parent fe05006 commit 10fc577
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/download_EML_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ download_EML_data <- function(data_url, meta_obj, meta_id, data_id, metadata_nod
data_name <- gsub(" ", "", data_name) # remove spaces
meta_name <- gsub("[^a-zA-Z0-9. -]+", "_", meta_id) #remove special characters & replace with _

# Also remove periods from various objects
meta_name <- gsub(pattern = "\\.", replacement = "_", x = meta_name)
data_name <- gsub(pattern = "\\.", replacement = "_", x = data_name)
data_extension <- gsub(pattern = "\\.", replacement = "_", x = data_extension)

# Assemble a new folder name
new_dir <- file.path(path, paste(meta_name, data_name, data_extension,
sep = "__"))
Expand Down
5 changes: 5 additions & 0 deletions R/download_ISO_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ ISO_type <- metadata2 %>% filter(name == "doc.children.MD_Metadata.children.meta
data_name <- gsub(" ", "", data_name) # remove spaces
meta_name <- gsub("[^a-zA-Z0-9. -]+", "_", meta_id) #remove special characters & replace with _

# Also remove periods from various objects
meta_name <- gsub(pattern = "\\.", replacement = "_", x = meta_name)
data_name <- gsub(pattern = "\\.", replacement = "_", x = data_name)
data_extension <- gsub(pattern = "\\.", replacement = "_", x = data_extension)

# Assemble a new folder name
new_dir <- file.path(path, paste(meta_name, data_name, data_extension,
sep = "__"))
Expand Down

0 comments on commit 10fc577

Please sign in to comment.