![]() ![]() Example Get-Content C:\Temp\PatchingServer.json | ConvertFrom-Json | ConvertTo-Csv | Out-File C:\Temp\Patching. ![]() I prefer to just copy the data from Excel, paste them in a decent editor (vscode, sublime text, notepad++) and use regular expressions to convert them to JSON. The target document format can be PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, HTML, TXT, CSV, RTF, ODT, ODS, ODP, XPS or OXPS. With the last command, the table is converted to the headers and values. If you have UTF-8 encoded data, exporting to CSV from Excel will mess them up. Click the 'Choose Files' button to select multiple files on your computer or click the dropdown button to choose an online file from URL, Google Drive or Dropbox. So the final command should be, Example Get-Content C:\Temp\PatchingServer.json | ConvertFrom-Json | ConvertTo-Csv Output "Port","ApplicationName","MaintenanceWindow","BusinessUnit","AppOwner","AppID","Location" Example PS C:\> Get-Content C:\Temp\PatchingServer.json |ConvertFrom-Json Output Port : 9000 We need to convert the above file to the CSV file so we will use the ConvertTo-CSV command but before that, we need the JSON file need to be converted from JSON format to table format using ConvertFrom-JSON so the ConvertTo-CSV command can make it into a readable format. Example PS C:\> Get-Content C:\Temp\PatchingServer.json To convert the JSON file to the CSV file using PowerShell, we need to use the ConvertTo-CSV command as a pipeline.įor example, we have a JSON file called PatchingServer.JSON stored at C:\temp and its content is as below. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |