Skip to contents

Extract file raw name and type from file names

Get file extensions without file names

Usage

file_name(filepath)

file_type(filepath)

Arguments

filepath

Character vector. File path(s) to get file raw names without extension nor path OR extension without path nor raw name.

Examples

file_name("file.aux")
#> [1] "file"
file_name("temp/file.R")
#> [1] "file"
file_name("/temp/temp3/music.mp3")
#> [1] "music"
file_type("file.aux")
#> [1] "aux"
file_type("temp/file.R")
#> [1] "r"
file_type("/temp/temp3/music.mp3")
#> [1] "mp3"