Closed htcfreek closed 1 day ago
Currently only xml, CSV and plain text are interpreted. It would be great if also Ini file content can be interpreted for conversation to json.
xml
CSV
plain text
When I need to convert from Ini file to JSON.
We need a small parser like this:
$ini = @{} switch -regex ($iniData) { “^\[(.+)\]” # Section { $section = $matches[1] $ini[$section] = @{} } “(.+?)\s*=\s*(.*)” # Key-Value-Pair { $name,$value = $matches[1..2] $ini[$section][$name] = $value } } # Return ($null if no results) if ($ini.Count -eq 0) { $ini = $null } return $ini
Written using PowerShell.
Notes to me:
dict<string,dict<string,string>>
^<section>\n<kvp>
This is released with PowerToys 0.82.0
Description of the new feature / enhancement
Currently only
xml
,CSV
andplain text
are interpreted. It would be great if also Ini file content can be interpreted for conversation to json.Scenario when this would be used?
When I need to convert from Ini file to JSON.
Supporting information
We need a small parser like this:
Written using PowerShell.