The csvlens is a command line tool specifically designed for viewing CSV (Comma-Separated Values) files. It offers a range of functionalities that make it easy to inspect and navigate through the contents of CSV files. It works like the less
command but is made specifically for CSV files. This tutorial shows how to install csvlens on Ubuntu 24.04.
Install csvlens
Download the newest version of csvlens from GitHub:
wget -qO csvlens.tar.xz https://github.com/YS-L/csvlens/releases/latest/download/csvlens-x86_64-unknown-linux-gnu.tar.xz
Create temporary directory and extract a tar.xz
file:
mkdir csvlens-temp
tar xf csvlens.tar.xz --strip-components=1 -C csvlens-temp
Place the executable in the /usr/local/bin
directory:
sudo mv csvlens-temp/csvlens /usr/local/bin
We can check csvlens version with command:
csvlens --version
Delete the downloaded file and the temporary directory:
rm -rf csvlens.tar.xz csvlens-temp
Testing csvlens
Create simple CSV file:
echo -e 'name,age\nJohn,25\nJames,29\nOliver,35\nEmma,31' > test.csv
Execute csvlens
command with the CSV file name as an argument:
csvlens test.csv
Now, you can navigate through the CSV file to view different parts of the data. Use the arrow keys to scroll through the content. Press the q
key to exit the viewer.
Uninstall csvlens
To remove csvlens completely, delete its corresponding file:
sudo rm -rf /usr/local/bin/csvlens
Leave a Comment
Cancel reply