August 26th, 2014

PowerTip: Create Custom Names for CSV File

Doctor Scripto
Scripter

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’

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.