PowerShell Command not working

I have a powershell command that removes lines from a large text file to make it a more manageable size. When I try to run it in MATLAB it gives an error
!powershell Get-Content oldfile.txt | Where {($_.ReadCount % 1000) -eq 0}|Set-Content newfile.txt
'Set-Content' is not recognized as an internal or external command,
operable program or batch file.
Any ideas how I can fix this?

1 件のコメント

Venkata Siva Krishna Madala
Venkata Siva Krishna Madala 2018 年 6 月 12 日
As posted by Kojiro Saito you have to put the command between double quotes.
!powershell "Get-Content oldfile.txt | Where {($_.ReadCount % 1000) -eq 0} | Set-Content newfile.txt"

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeEntering Commands についてさらに検索

製品

タグ

質問済み:

2018 年 6 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by