Skip to contents

Internally used in rename_files_with_number() for ex. Warning: don't work when there is '.' in the name of the file before the extension

Usage

get_file_extension(file_path)

Arguments

file_path

(required): path to a file

Value

The extension of a file.

Author

Adrien Taudière

Examples

get_file_extension("my_file.csv")
#> [1] "csv"
get_file_extension("my.file.csv")
#> Warning: There is more than one '.' inside your file path: my.file.csv
#> [1] "file" "csv" 
get_file_extension("my_file.csv.zip")
#> Warning: There is more than one '.' inside your file path: my_file.csv.zip
#> [1] "csv" "zip"