CSV file viewers (lightweight)

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,133
Reaction score
1,242
Location
SF Bay Area
Many of the utilities and Blue Iris actions I post on ipcamtalk create CSV files. I thought I'd share the 'lightweight' CSV file viewers I routinely use to inspect *.csv files. Of course, you can open CSV files in your favorite text editor, but often these viewers are not ideal for inspecting data that is organized in columns. And while Microsoft Excel is extremely capable, you may be like me and prefer not to install Microsoft Office on your Blue Iris PC; thus avoiding its overhead and frequent update requests.

Here are two alternatives to installing Excel:
1. Windows Powershell 'Out-GridView' cmdlet
2. NirSoft CSVFileView

1. Windows Powershell 'Out-GridView' cmdlet:

Tool/UtilityDescription
GridView.bat(in attached GridView.zip) opens PowerShell's built-in 'Out-GridView' cmdlet
GridView.ps1(in attached GridView.zip) required by GridView.bat (must be in same folder!)
csv_file_view_context_menu1.reg(in attached registry_tweaks.zip) registry tweak to add *.csv file context menu support for Windows Explorer


Why you may want to use the GridView cmdlet

Powershell's built-in 'GridView' cmdlet is an excellent, lightweight alternative to Microsoft Excel for inspecting CSV files. It is fast and extremely capable, including a robust filtering capability... If you use the provided registry tweak (*.reg file), you can add a right-click context menu entry to use GridView with any *.csv file in Windows Explorer (see 2nd image below), or in an Internet browser download toolbar... To learn more about GridView click here (v5), and here (v7). To learn about how to use filtering and other features, click here.

Notes:
  • The 'Out-GridView' cmdlet does not show the number of rows in the file. NirSoft's CsvFileView (below) does not have this disadvantage.
  • The 'Out-GridView' cmdlet may hide underscore characters in header labels. For example label 'Mainstream_FPS' may be displayed as 'MainstreamFPS'.
  • The 'Out-GridView' cmdlet may have problems if the first header row label contains a '#' character.
  • The 'Out-GridView' cmdlet sometimes seems 'picky' and will not load *.csv files that will open using NirSoft's CsvFileView (below). For this reason you might want to install both tools.

Screenshot of the PowerShell 'Out-GridView' cmdlet.
csv_view1.png


Example using the PowerShell 'Out-GridView' cmdlet via a right-click context menu in Windows Explorer.
csv_view2.png


How to use GridView ...

NOTE: If you've never used PowerShell on your Blue Iris PC, you will first to need to change its default security policy. Open PowerShell and type the following, then hit the Enter key: Set-ExecutionPolicy RemoteSigned ... (click here for a nice beginner's tutorial to using PowerShell).
  1. Copy the 'GridView.*' files to your batch folder, typically 'c:\bat'.
  2. If in #1 you used a folder other than 'c:\bat', open the *.reg file and edit it accordingly.
  3. Double-click the *.reg file and allow it to change your registry.
  4. Right-click on a *.csv file; select the desired option.

2. NirSoft CSVFileView (NirSoft):

Tool/UtilityDescription
application(download) CSV / Tab delimited file viewer and converter for Windows
csv_file_view_context_menu2.reg(in attached registry_tweaks.zip) registry tweak to add *.csv file context menu support for Windows Explorer


Why you may want to use CSVFileView ...

CSVFileView is a free 3rd-party CSV viewer. It is a decent alternative to PowerShell's 'GridView' cmdlet (above), albeit with some limitations for very large files, and a more complex filtering interface. You may want to experiment with both viewers to determine your preference (or use both like I do, depending on my need)... If you use the provided registry tweak (*.reg file), you can add a right-click context menu entry to use CSVFileView with any *.csv file in Windows Explorer (see 2nd image above).

CSVFileView has these advantages versus the Windows PowerShell 'Out-GridView' cmdlet:
  • CSVFileView shows the number of rows in the file (see the lower-left corner).
  • CSVFileView can be searched (use Ctrl-F).
  • CSVFileView allows cell values to be copied (double-click on a row to access individual cell values).
  • CSVFileView is much less finicky and will open files that the PowerShell 'Out-GridView' cmdlet struggles with.

Total row count is displayed in the lower-left corner...
csv_view3.png


Double-click on any row to access individual cell values...
csv_view4.png


How to use CSVFileView ...
  1. Install the 'CSVFileView.exe and .chm' files to your batch folder, typically 'c:\bat'.
  2. If in #1 you used a folder other than 'c:\bat', open the *.reg file and edit it accordingly.
  3. Double-click the *.reg file and allow it to change your registry.
  4. Right-click on any *csv file; select the desired option.

Zip Attachments:
 

Attachments

Last edited:

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,133
Reaction score
1,242
Location
SF Bay Area
CSV File 'Gotchas'

Following are recommendations for avoiding issues with programmatically-created CSV files...

Recommendations:

Header row cells:
  • Use only letters and numbers; do not use spaces and special characters (like underscores, slashes, parentheses, brackets, etc.). ***
  • To improve readability, use 'caseSeparation' or 'CamelCase' styles.

Data row cells:
  • Spaces and commas may be used within column values. If either are present, or expected, enclose the entire cell entry in matching quotes.

Column (cell) separators:
  • Always use the comma delimiter between cells.

*** The Windows Powershell 'Out-GridView' cmdlet viewer is particularly sensitive to these issues
 
Top