我使用以下脚本使用solr API查询和获取数据,并将生成的csv输出作为csv文件读取。我想将此脚本移植到RShiny服务器中运行。有什么建议吗?
url <- "curl 'https://[site.orgnaization.com/solr/someFolder/select?q=*:*&rows=1000&wt=csv' -L -u username:password --location-trusted -b cookie-jar.txt > C:/Folder/Filename.csv"
fileConn <- file("C:/Folder/PowerShellFile.ps1")
writeLines(url, fileConn)
close(fileConn)
system2("PowerShell", args = c("-file", "C:\\Folder\\PowerShellFile.ps1"))
DataFromSolr <- data.frame(read.csv("C:/Folder/Filename.csv",header = TRUE, sep = "," , fill = TRUE ,fileEncoding = "UTF-16LE"))
答案 0 :(得分:0)
我从linux服务器上的这个站点[https://github.com/PowerShell/PowerShell/blob/master/docs/installation/linux.md#ubuntu-1604]安装了PowerShell,解决了这个问题。