split_into_root_folder_file_extension: Split Full Paths into Root, Folder, File and Extension

Description Usage Arguments Value Examples

View source: R/split_into_root_folder_file_extension.R

Description

Split Full Paths into Root, Folder, File and Extension

Usage

1
split_into_root_folder_file_extension(paths, n_root_parts = 0)

Arguments

paths

vector of character representing full file paths

n_root_parts

number of first path segments considered as "root"

Value

data frame with columns root, folder, file, extension, depth

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
paths <- c(
  "//always/the/same/root/project-1/intro.doc",
  "//always/the/same/root/project-1/logo.png",
  "//always/the/same/root/project-2/intro.txt",
  "//always/the/same/root/project-2/planning/file-1.doc",
  "//always/the/same/root/project-2/result/report.pdf"
)

split_into_root_folder_file_extension(paths)
split_into_root_folder_file_extension(paths, n_root_parts = 6)
split_into_root_folder_file_extension(paths, n_root_parts = 7)

KWB-R/kwb.file documentation built on Dec. 31, 2021, 8:15 p.m.