'Replace blank in single csv column throughout multiple files

I am trying to sift through a batch of CSV files (using | as delimiter but prepared to replace pipes with commas if needed) replacing any blank field with another value using PowerShell. The CSVs don't have headers, so I need to add headers to focus on column 3, but the file written back to disk needs to not have these headers.

I've tried the following with no luck. It seems to do nothing:

  $files = Get-ChildItem "~\Desktop\Test\*.csv"
foreach ($f in $files)
{
    $outfile = $f.FullName + "mod"
    $data = Import-csv $f -Header A , B , C , D , E , F , G
$data |
   ForEach-Object {
$_.C = $_.C -replace "" , "BLANK"}
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source