Skip to content

Instantly share code, notes, and snippets.

@abombss
Created August 6, 2011 19:18
Show Gist options
  • Save abombss/1129655 to your computer and use it in GitHub Desktop.
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
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'"
}
@mmcmd
Copy link

mmcmd commented Apr 12, 2018

Thank you for sharing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment