How to press any key to continue after running a command prompt

11 ビュー (過去 30 日間)
Ifeoluwa Ajiboye
Ifeoluwa Ajiboye 2022 年 6 月 28 日
回答済み: Fangjun Jiang 2022 年 6 月 28 日
i am runnig a command pompt instruction using system(command) where command is a string for instructions to convert some data to CSV files (included in that string is an EXE which converts TDF files also in that string to CSV files). When this is run, the program executes and converts TDF fiies to CSV, after this, there is a press any key to continue to be done.
However, in matlab, my program is just stalled after the files have been converted. How can i add this press any key to the instruction?
  3 件のコメント
Ifeoluwa Ajiboye
Ifeoluwa Ajiboye 2022 年 6 月 28 日
No it does not the command is "<TDF2CSV.exe" "file2convert.TDF".
Jan
Jan 2022 年 6 月 28 日
Where did you get this function from? Is there a documentation?

サインインしてコメントする。

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2022 年 6 月 28 日
This is an old technique. Run command as
TDF2CSV.exe file2convert.TDF << Dummy.txt
where Dummy.txt is a text file which contains one character (for your case).
The symbol "<<" is used to re-direct the content of the text file to the command prompt, as if the content of the text file is entered as key input at the prompt. It could be used to provide more elaborate inputs, but in your case, it is just any one key input.
Try this first at the command prompt directly and then make it work with system().
I wonder if below would also work, try it.
TDF2CSV.exe file2convert.TDF << "A"

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by