简体   繁体   中英

Spotfire : How to modify an URL in an input field (after being entered by the user)

I'm trying to import a file in spotfire depending on the path entered by the user.

I'm using a data function (R script). As you know, in R all "\\" are not recognized and consequently must be replaced by : "/".

If the user is entered in the input filed the path with "/" as delimiter : the file is well importing.

I would like to adapt my R script in order to permit users to paste his original path (with "\\") and then to replace with "/".

I don't understand well why it seem like we can't use R function like paste on the variable containing the input field (see the following pictures).

Note that path is the name of the document proporty (the input filed) and the script has been tested with and without the as.character line.

Can someone help me?

Any help would be appreciated :)

can't you use simple regex to replace '\\' with '/'? Something like

sub('\\', '/', str)

(You probably need to escape this)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM