Install csview on Ubuntu 24.04

Install csview on Ubuntu 24.04

The csview command is a tool designed to quickly view and inspect CSV files directly from the command line. It provides a convenient way to display the contents of a CSV file in a formatted table without needing to open it in a spreadsheet application. This tutorial shows how to install csview on Ubuntu 24.04.

Install csview

Check the current csview version from its GitHub repository and assign it to a variable:

CSVIEW_VERSION=$(curl -s "https://api.github.com/repos/wfxr/csview/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')

Use the identified version to download the csview archive:

wget -qO csview.tar.gz https://github.com/wfxr/csview/releases/latest/download/csview-v$CSVIEW_VERSION-x86_64-unknown-linux-gnu.tar.gz

Create temporary directory and extract a tar.gz file:

mkdir csview-temp
tar xf csview.tar.gz --strip-components=1 -C csview-temp

Move executable to /usr/local/bin directory:

sudo mv csview-temp/csview /usr/local/bin

Use this command to determine the csview version:

csview --version

Delete the unnecessary archive and directory:

rm -rf csview.tar.gz csview-temp

Testing csview

Create simple CSV file:

echo -e 'name,age\nJohn,25\nJames,29\nOliver,35\nEmma,31' > test.csv

Execute csview command with the CSV file name as an argument:

csview test.csv

The command will display the contents of a file in a tabular format, allowing you to easily inspect the data without opening a full-fledged spreadsheet application.

View CSV file with csview on Ubuntu

Uninstall csview

To uninstall csview, delete the associated file:

sudo rm -rf /usr/local/bin/csview

Leave a Comment

Cancel reply

Your email address will not be published.