Showing posts with label Export CSV. Show all posts
Showing posts with label Export CSV. Show all posts

Thursday, April 23, 2020

Exporting command output to csv,import csv and see the content as a formatted table in powershell 7 in Debian 10

exporting command output to a csv file

get-process |  sort-object -property ws -descending | select-object -property processname,ws -first 5|Export-csv /home/sourav/Desktop/top5proc.csv


to see the content of the csv

 Get-Content ./Desktop/top5proc.csv


to impoer the csv file

import-csv ./Desktop/top5proc.csv  

if there are lots of data in the csv file we can format the output which will produce data in a more readable format

import-csv ./Desktop/top5proc.csv|Format-Table