如何在cmd或powershell中运行以下脚本?

时间:2018-02-21 07:05:07

标签: powershell powershell-v4.0

我正在使用CSV将metastock数据格式转换为atem64 converter。基本上atem64是exe文件,-o是输出文件,行尾的目录是源目录。现在我想自动化这个过程,而不是在cmd中逐个运行它们。我想我可以使用循环,但我仍然不太了解powershell,现在我的重点是完成我在Golang中编程的stockparser以及将使用这些数据的后端API。但在我将这些内容上传到数据库之前,我需要CSV格式,有人可以帮助我吗?

可以在另一个文本文件中指定每个源和相应的输出目录/文件,然后通过循环运行atem64吗?

atem64 -F, -o "./ATEM Convert Day/Global FX.TXT" -f "-time,-openint" --ignore-master "./Download Day/Global FX"
atem64 -F, -o "./ATEM Convert Day/Global Index.TXT" -f "-time,-openint" --ignore-master "./Download Day/Global Index"
atem64 -F, -o "./ATEM Convert Day/HFRI.TXT" -f "-time,-openint" --ignore-master "./Download Day/HFRI"
atem64 -F, -o "./ATEM Convert Day/US AMEX.TXT" -f "-time,-openint" --ignore-master "./Download Day/US AMEX"
atem64 -F, -o "./ATEM Convert Day/US NASDAQ.TXT" -f "-time,-openint" --ignore-master "./Download Day/US NASDAQ"
atem64 -F, -o "./ATEM Convert Day/US NASDAQ ETF.TXT" -f "-time,-openint" --ignore-master "./Download Day/US NASDAQ ETF"
atem64 -F, -o "./ATEM Convert Day/US NYSE.TXT" -f "-time,-openint" --ignore-master "./Download Day/US NYSE"



atem64 -F, -o "./ATEM Convert Day/Global FX Symbols.TXT" -s --ignore-master "./Download Day/Global FX"
atem64 -F, -o "./ATEM Convert Day/Global Index Symbols.TXT" -s --ignore-master "./Download Day/Global Index"
atem64 -F, -o "./ATEM Convert Day/HFRI Symbols.TXT" -s --ignore-master "./Download Day/HFRI"
atem64 -F, -o "./ATEM Convert Day/US AMEX Symbols.TXT" -s --ignore-master "./Download Day/US AMEX"
atem64 -F, -o "./ATEM Convert Day/US NASDAQ Symbols.TXT" -s --ignore-master "./Download Day/US NASDAQ"
atem64 -F, -o "./ATEM Convert Day/US NASDAQ ETF Symbols.TXT" -s --ignore-master "./Download Day/US NASDAQ ETF"
atem64 -F, -o "./ATEM Convert Day/US NYSE Symbols.TXT" -s --ignore-master "./Download Day/US NYSE"

1 个答案:

答案 0 :(得分:0)

我通过在每行前面添加.\并将-F,更改为-F","来解决此问题 虽然如果我可以使用循环来做它仍然会很好。无论如何,只有几行,所以我认为这不重要