简体   繁体   English

Spotfire:如何在输入字段中修改URL(在用户输入之后)

[英]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. 我正在尝试根据用户输入的路径在Spotfire中导入文件。

I'm using a data function (R script). 我正在使用数据功能(R脚本)。 As you know, in R all "\\" are not recognized and consequently must be replaced by : "/". 如您所知,在R中所有“ \\”都不被识别,因此必须用:“ /”代替。

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 "/". 我想修改我的R脚本,以允许用户粘贴其原始路径(用“ \\”),然后用“ /”代替。

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). 我不太了解为什么我们似乎无法像在包含输入字段的变量上粘贴那样使用R函数(请参见下图)。

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. 请注意,路径是文档比例(输入字段)的名称,并且该脚本已经过测试,带有和不带有as.character行。

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) (您可能需要对此逃避)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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