Getting from CSV to JSON is pretty easy

Mar 26, 2018 Dev, General
[Reading Time: < 1 minute]

This is a short reminder for myself, but could be helpfull for someone else out there. Nothing new!

I often look for easy solution, that resolve “easy” problems. This is one: “Convert something to something”.

After looking arround in the outer spheres of Internet, I realize, that OoB tools can do the job better or at least without any dependencies or such things.

So, how to convert a regular CSV to JSON? Take PowerShell!

Get-Content -Path $csvPath | ConvertFrom-Csv -Delimiter "`t" | ConvertTo-Json | Set-Content -Path $jsonPath -Encoding UTF8

It’s easy, isnt’it 🙂

By Thomas

As Chief Technology Officer at Xpirit Germany. I am responsible for driving productivity for our customers by a full stack of dev and technology in modern times. But I not only care for technologies from Microsofts stack like Azure, AI, and IoT, but also for delivering quality and expertise with DevOps

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.