PowerTip: Create Custom Names for CSV File

Doctor Scripto

Summary: Use Windows PowerShell to create custom column headings.

Hey, Scripting Guy! Question How can I use Windows PowerShell to generate custom heading for a CSV file when I import it?

Hey, Scripting Guy! Answer Specify the –Header parameter as an array of names in the order of the fields, for example:

Import-CSV c:\fso\myfile.csv –delimiter “:” –header ‘FName’, ‘LName’, ‘Street’, ‘City’, ‘State’, ‘Zip’

0 comments

Discussion is closed.

Feedback usabilla icon