When working with some CSV files in my Windows Servers, I was wondering how can I view the CSV file without installing any third-party viewers.
Here is my one-liner PowerShell solution. I am using Out-GridView with “-Wait” option. Make sure PowerShell Execution Policy is set to run local scripts.
Here is how you do it
Log onto to your Windows Server (or on your local computer).
Open Notepad.
Copy and Paste this code into Notepad:
REM
REM ** SUPER DUPER CSV FILE VIEWER **
REM
REM ...:::> Anand, the Awesome <:::...
Start /Wait Powershell -Command "Import-Csv -Path %1 | Out-GridView -Title %1 -Wait"
Save this file as CSV-Viewer.bat in your favorite location.
Now find a CSV file on your disk, right-click and go to Properties. Change Open With to the CSV-Viewer.bat file that you created in above step.

That’s all. Now try double-clicking on any CSV file. It will open GridView. You can search things in the CSV file, or sort any column or Filter the data.
