Skip to content

Instantly share code, notes, and snippets.

@dcouto
Created December 8, 2025 16:21
Show Gist options
  • Select an option

  • Save dcouto/9fdc01a48726293a118757e52838b551 to your computer and use it in GitHub Desktop.

Select an option

Save dcouto/9fdc01a48726293a118757e52838b551 to your computer and use it in GitHub Desktop.
# Input / Output
$inputPath = ".\h=20\m=00\PT1H.json"
$outputPath = ".\h=20\m=00\PT1H-resultDescription.txt"
Get-Content -LiteralPath $inputPath |
ForEach-Object {
try {
($_.Trim() | ConvertFrom-Json).resultDescription
}
catch {
$null # skip malformed lines
}
} |
Where-Object { $_ -ne $null } |
ForEach-Object { $_.TrimEnd() } |
Set-Content -LiteralPath $outputPath -Encoding UTF8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment