[英]run system() call in R for command line tool
I am trying to write a script in which I need to run a command line tool to parse the xml to csv file. 我正在尝试编写一个脚本,在该脚本中,我需要运行命令行工具以将xml解析为csv文件。 it works as this:
它是这样的:
XmlToCsv.Console.exe -xml file.xml -dir C:/Desktop.
So I replicated this in R as 所以我在R中将其复制为
system('XmlToCsv.Console.exe -xml file.xml -dir C:/Desktop')
but it is not working. 但它不起作用。 Does anyone know what I did wrong?
有人知道我做错了吗?
Some possible issues: 一些可能的问题:
Is the location really C:/Desktop
? 该位置真的是
C:/Desktop
吗? If you have spaces in your path, then that path needs to be wrapped in quotes, and probably needs to already exist. 如果路径中有空格,则该路径需要用引号引起来,并且可能已经存在。 (I don't know if
XmlToCsv.Console.exe
will create it automatically if it doesn't.) (我不知道
XmlToCsv.Console.exe
是否会自动创建它。)
If you are using Windows then XmlToCsv.Console.exe
should be contained in a folder listed in the PATH environment variable. 如果使用Windows,则
XmlToCsv.Console.exe
应该包含在PATH环境变量中列出的文件夹中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.