在 Windows PowerShell 中逐行讀取檔案
在 Windows PowerShell 中,我們可以使用 Get-Content cmdlet 從檔案中讀取檔案。但是,該 cmdlet 會立即將整個檔案內容載入到記憶體中,這會導致大檔案失敗或凍結。 為了解決這個問題,我們可以做的是我們可以逐行讀取檔案,本文將向你展示如何。
2023年1月30日
PowerShell
PowerShell File
最受歡迎文章
![在 PowerShell 中提取子字串](/img/PowerShell/feature%20image%20-%20extracting%20a%20substring%20in%20powershell.png)
在 PowerShell 中提取子字串
2023年1月30日
PowerShell
PowerShell String
![在 PowerShell 中安裝軟體](/img/PowerShell/feature%20image%20-%20install%20software%20using%20powershell.png)
在 PowerShell 中安裝軟體
2023年1月30日
PowerShell
PowerShell Install
![從批處理檔案執行 PowerShell 指令碼](/img/PowerShell/feature%20image%20-%20run%20a%20powershell%20script%20from%20a%20batch%20file.png)
從批處理檔案執行 PowerShell 指令碼
2023年1月30日
PowerShell
PowerShell Script
![在 PowerShell 中查詢子字串的位置](/img/PowerShell/feature%20image%20-%20powershell%20indexof.png)
在 PowerShell 中查詢子字串的位置
2023年1月30日
PowerShell
PowerShell String
![在 PowerShell 中執行帶引數的 exe 檔案](/img/PowerShell/feature%20image%20-%20powershell%20run%20exe.png)
在 PowerShell 中執行帶引數的 exe 檔案
2023年1月30日
PowerShell
PowerShell EXE
最近更新的文章
![PowerShell 下載檔案](/img/PowerShell/feature%20image%20-%20powershell%20download%20file.png)
PowerShell 下載檔案
2023年2月6日
PowerShell
PowerShell Download
![使用 PowerShell 檢查字串的開頭](/img/PowerShell/feature%20image%20-%20check%20the%20beginning%20of%20a%20string%20using%20powershell.png)
使用 PowerShell 檢查字串的開頭
2023年1月30日
PowerShell
PowerShell String
![使用 PowerShell 將資料附加到檔案](/img/PowerShell/feature%20image%20-%20appending%20data%20to%20file%20using%20powershell.png)
使用 PowerShell 將資料附加到檔案
2023年1月30日
PowerShell
PowerShell File
![在 PowerShell 的命令輸出中新增新行](/img/PowerShell/feature%20image%20-%20add%20a%20new%20line%20to%20command%20output%20in%20powershell.png)
在 PowerShell 的命令輸出中新增新行
2023年1月30日
PowerShell
PowerShell New Line
![在 PowerShell 中訪問 $args 陣列](/img/PowerShell/feature%20image%20-%20accessing%20the%20args%20array%20in%20powershell.png)
在 PowerShell 中訪問 $args 陣列
2023年1月30日
PowerShell
PowerShell Array