如何在 powershell 的 CSV 文件中过滤列中的空值

问题描述 投票:0回答:0

我有样本test.csv文件

"#P","A","E","S"
 "1","2","3","4"
 "3","5","6",""
 "A","B","C",""
 "D","F","G","H"

I want output csv file export.csv as
"P","A","E","S"
"1","2","3","4"
"D","F","G","H"




 $File1 = Import-Csv -Path "test.csv" -Header "P","A","E","S" | Where { $_.S -ne $null } | Export-Csv "export.csv" -Force -NoTypeInformation

我试过这段代码。哪个不起作用

powershell csv null multiple-columns
© www.soinside.com 2019 - 2024. All rights reserved.