Extract File Extension
file_extension(x, ext = NULL)
x | path as a character vector. |
---|---|
ext | extension to append instead of the original extension. |
file_extension('alpha.txt')#> [1] "txt"#> [1] "tt1" "tt2" "tt3" "tt4" "tt5"#> [1] "aa.pdf" "aa.pdf" "aa.pdf" "aa.pdf" "aa.pdf"#> [1] "aatt1.pdf" "aatt2.pdf" "aatt3.pdf" "aatt4.pdf" "aatt5.pdf"