简体   繁体   中英

How to run bat file with arguments from a java program? (Trying to automate using a Command Line Tool )

我正在尝试使用命令行工具“Tarql”进行一些数据转换(提供 csv 和 sparql 查询,它将把 csv 文件转换为 ttl 格式)。

This is how usually we pass multiple space-separated commands to process builder

ProcessBuilder pb = new ProcessBuilder("command", "command_arg1",
"command_arg2","command_arg3", "command_arg4", ...);

If I am running "ls -lrt /home/ubuntu/test" my ProcessBuilder will look like

ProcessBuilder pb = new ProcessBuilder("ls", "-lrt",
"/home/ubuntu/test");

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