Updating a CSV table

I have a csv file without header (data only) and need to remove the decimal point on certain rows but not others and maintain the csv format. I thought I solved it by using the import-csv with the export-csv, BUT found the export-csv was adding a header row.
I cannot have the header row ffor the application that uses this csv table.

My boss would like us to update the incoming csv without creating a new table, But I will sell either way solong as I can remove the decimal point on the selected rows and no header in the solution, My current code:
$csv = Import-Csv -Path .\desktop\PeriodYes.csv -Header C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12
foreach ($line in $csv)
{
if ($line.C1 -eq ‘M’) {$Line.C4=$Line.C4 -replace ‘[.]’,‘’; write-host $Line} export-csv -InputObject $Line -Path .\desktop\PeriodNo.csv -NoTypeInformation -append}

Thanks

StillLearning,
Welcome to the forum. :wave:t4:

Because that’s actually part of the specification and every tool able to deal with valid CSV files shouldn’t have an issue with headers.

If you need to remove the headers anyway you can simply read the CSV file as plain text file with Get-Content and use a Select-Object -Skip 1 to remove the first row.

BTW: When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in PowerShell.org <---- Click :point_up_2:t4: :wink: