I'm splitting a csv on the comma and taking the 6th cell:
Get-Content .\BSEG_EXPORT.csv | foreach { $_.Split(",")[6] }
However, this returns a lot of empty strings (no match on the current line):
""
""
"something"
""
""
How can I ommit the "" in my output? So:
"something"
I tried
Get-Content .\BSEG_EXPORT.csv | foreach { $a = $_.Split(",")[6] } | Where { $a -ne "" }
but this does not work.