Make use of Extended IT to bolster your IT Support Offering
Extend your IT

Easily Split NDJSON files to JSON with PowerShell

Just a quick post to share a script I just had to write to split an NSJSON file out into individual JSON files for processing through a 3rd Party Application.

$content = Get-Content "path to NDJSON file goes here"

foreach ($data in $content){

    $random = -join ((65..90) + (97..122) | Get-Random -Count 25 | % {[char]$_})
    $data | out-file "<output folder goes here>\$random.json"


Simply point it at your NDJSON file and fill on your output folder and it will split each line out into it’s own JSON file.

For the up to date version of the script get it from GitHub