Created
August 6, 2011 19:18
-
-
Save abombss/1129655 to your computer and use it in GitHub Desktop.
Powershell script to toggle and change the windows regional settings for the list separator to make outputting CSV files from excel using different delimiters much easier
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toggle-list-sep | |
{ | |
$path = "hkcu:\Control Panel\International" | |
$key = "sList" | |
$cur_sep = (Get-ItemProperty -path $path -name $key).$key | |
if ($args.Length -gt 0) { $value = $args[0] } | |
elseif ($cur_sep -eq ",") { $value = "|" } | |
else { $value = "," } | |
Set-ItemProperty -path $path -name $key -Value $value -type string | |
$new_sep = (Get-ItemProperty -path $path -name $key).$key | |
Write-Output "Changed $path.$key from '$cur_sep' to '$new_sep'" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for sharing this!