Validate filenames based on a specified separator
validate_filenames.Rd
This function checks if all filenames in a given vector use a specified separator consistently and return FALSE if there's any inconsistency.
Value
A logical value indicating whether all filenames use the specified separator consistently. Returns FALSE if any inconsistency is found.
Examples
# Test case for inconsistent separator usage
filenames <- c("file name-1.txt", "file name 2.csv", "file name 3.doc")
validate_filenames(filenames, "space") # Should return FALSE
#> [1] FALSE
filenames <- c("file-name-1.txt", "file_name-2.csv", "file_name-3.doc")
validate_filenames(filenames, "underscore") # Should return TRUE
#> [1] FALSE
filenames <- c("file-name-1.txt", "file_name-2.csv", "file name-3.doc")
validate_filenames(filenames, "underscore") # Should return FALSE
#> [1] FALSE