[R] How to convert "c:\a\b" to "c:/a/b"?

From: Spencer Graves <spencer.graves_at_pdf.com>
Date: Mon 27 Jun 2005 - 13:30:52 EST

          How can one convert back slashes to forward slashes, e.g, changing "c:\a\b" to "c:/a/b"? I tried the following:

> gsub("\\\\", "/", "c:\a\b")

[1] "c:\a\b"

          Since this didn't work, I eliminated the replacement as a contributor as follows:

> gsub("X", "/", "c:XaXb")

[1] "c:/a/b"

          The following seems to illustrate the problem:

  strsplit("c:\a\b", "")
[[1]]
[1] "c" ":" "\a" "\b"

          How can one automate this?

	  Thanks,
	  spencer graves
-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves@pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Mon Jun 27 13:36:03 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:03 EST