CSV-Files With Culture

In a previous tip, you learned that CSV files use different separators, depending on your culture. While you were unable to select a separator in PowerShell V1, in PowerShell v2 you now can use the new -Delimiter parameter to specify your own. An even better way is to use -UseCulture. This way, PowerShell automatically detects the appropriate delimiter character for your culture and uses it:

Get-Service | Export-CSV $home\services.csv -UseCulture
. "$home\services.csv"

Twitter This Tip! ReTweet this Tip!


Posted Aug 25 2009, 08:00 AM by ps1
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.