Skip to content

Instantly share code, notes, and snippets.

@jackfruh
Created July 23, 2020 00:52
Show Gist options
  • Save jackfruh/58d81786066bec15eca93750972b2fce to your computer and use it in GitHub Desktop.
Save jackfruh/58d81786066bec15eca93750972b2fce to your computer and use it in GitHub Desktop.
write-host "this script will convert Fanalab Configuration files from UK format to US format"
write-host "(UK numbers like 84,7 will be replaced with 84.7)"
write-host "Run this from the same directory as the profiles you want to convert"
write-host "They will be placed in a new folder named NA"
$filelist = get-childitem -filter "*.pws" -Path . -File
if ($(test-path -path "NA" ) -ne $true)
{
new-item -path "NA" -ItemType Directory
}
foreach ($file in $filelist)
{
#create a new filename that ends in _NA before the extension:
$newFilename = "NA\$($file.basename)_NA$($file.extension)"
$content = get-content $file
write-host "outputing North American format file $newfilename"
$content.replace(",",".") | out-file $newFilename -NoClobber -Encoding utf8
}
write-host "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment