R/utilities.R
file_ext.Rd
Based on the separating character, file_ext
determines the file extension and path_no_ext
determines the file path without the extension.
file_ext(path, sep_char = ".")
path_no_ext(path, sep_char = ".")
character
value of the file path possibly with an extension.
character
value of the separator that delineates the extension from the file path. Generally, this will be "."
, but for some API URLs, the extension is actually a query component, so the separator may sometimes need to be "="
.
character
value of the extension (file_ext
) or the path without the extension (path_no_ext
.
file_ext("home/folders.with.dots/stuff/ok.csv")
#> [1] "csv"
path_no_ext("home/folders.with.dots/stuff/ok.csv")
#> [1] "home/folders.with.dots/stuff/ok"