Skip to content

Instantly share code, notes, and snippets.

@sannae
Created December 12, 2022 18:18
Show Gist options
  • Save sannae/3de380638ff20716359433b32140afb7 to your computer and use it in GitHub Desktop.
Save sannae/3de380638ff20716359433b32140afb7 to your computer and use it in GitHub Desktop.
Adds a new column to an existing CSV file by specifying NewColumnTitle and NewColumnValue
$NewColumnTitle = 'GRUPPODIP'
$NewColumnValue = ''
Import-csv anagrafica.csv |
Select-object *, @{Name=$NewColumnTitle; Expression={$NewColumnValue}} |
ConvertTo-csv -Delimiter ';' -NoTypeInformation |
Foreach-Object { $_.Replace('"','') } |
out-file anagrafica_GRUPPI.csv -encoding UTF8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment