Skip to content
Prev 95745 / 398500 Next

string problems with "\\" (Windows)

basename() works.  If you're on a system that doesn't think \\ is a path 
separator, you could do something like

x <- "C:\\Documents and Settings\\myName\\My 
Documents\\RProjects\\Project1\\file.name.csv"
basename(gsub('\\\\','/',x))

Duncan Murdoch
Charles Annis, P.E. wrote: