defoo defoo - 1 year ago 97
R Question

Find file name from full file path

Is there a way to extract the file name from the file full path (part of a file path) without the hassle of manipulating string?

The equivalent in Java would be:

File f = new File ("C:/some_dir/a")
f.getName() //output a
f.getFullAbsolutePath() //output c:/some_dir/a

mjv mjv
Answer Source


> [1]  "a"

>[1] "C:/some_dir"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download