From: Ted Harding <Ted.Harding_at_nessie.mcc.ac.uk>

Date: Tue 28 Jun 2005 - 22:38:49 EST

E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jun 28 22:50:55 2005

Date: Tue 28 Jun 2005 - 22:38:49 EST

On 27-Jun-05 Spencer Graves wrote:

> Thanks, Dirk, Gabor, Eric:

*>
**> You all provided appropriate solutions for the stated problem.
**> Sadly, I oversimplified the problem I was trying to solve: I copy a
**> character string giving a DOS path from MS Windows Explorer into an R
**> script file, and I get something like the following:
**>
**> D:\spencerg\statmtds\R\Rnews
**>
**> I want to be able to use this in R with its non-R meaning,
*

e.g., in

> readLine, count.fields, read.table, etc., after appending a file name.

*> Your three solutions all work for my oversimplified toy example but are
**> inadequate for the problem I really want to solve.
*

The various responses show that solving this problem directly within R may be, well, problematic!

echo "D:\spencerg\statmtds\R\Rnews" | sed 's@\\@/@g'

Note: the parsing of the 'sed' command is as follows:

s@x@y@g means substitute "y" for every ("g" = "global") occurrence

An alternative using "/" as separator would be

echo "D:\spencerg\statmtds\R\Rnews" | sed 's/\\/\//g' D:/spencerg/statmtds/R/Rnews

E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861

Date: 28-Jun-05 Time: 13:38:37 ------------------------------ XFMail ------------------------------ ______________________________________________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 Tue Jun 28 22:50:55 2005

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