To delete empty rows in multiple CSV files by using Powershell. This is the code I am trying to use for each loop. But it is writing empty files. The resulting file should open in Excel and Notepad++ in proper format.
Get-ChildItem $paramDest -Filter *Test*.csv | ForEach-Object {$content = Get-Content $_.FullName | Where { $_.Replace("","","").trim() -ne "" }Out-File -InputObject $content -FilePath $_.FullName}
I have some other set of files, the code should work for both these kinds of files. I am okay to have 2 separate codes for these 2 separate files.
Here is another file sample format