1
cloudzhou 2013-10-28 18:29:07 +08:00
http://stackoverflow.com/questions/1431551/command-line-pipe-input-in-java
By executing "java Read < input.txt" you've told the operating system that for this process, the piped file is standard in. You can't then switch back to the command line from inside the application. If you want to do that, then pass input.txt as a file name parameter to the application, open/read/close the file yourself from inside the application, then read from standard input to get stuff from the command line. |
2
delo 2013-10-28 19:19:48 +08:00 via iPhone
cat input.txt | java filename 试试不保证有效
|
3
msg7086 2013-10-28 19:55:38 +08:00
for循环,然后开一个长字符串,把操作指令和循环变量拼一起,最后塞给程序。
|