Install xlsx2csv on Raspberry Pi

Install xlsx2csv on Raspberry Pi

The xlsx2csv is a command line tool that allows to convert MS Excel (XLSX) files to CSV files. This tool requires the Python interpreter.

This tutorial shows how to install xlsx2csv on Raspberry Pi.

Connect to Raspberry Pi via SSH. Then update the package lists and install xlsx2csv with commands:

sudo apt update
sudo apt install -y xlsx2csv

We can check version of xlsx2csv:

xlsx2csv --version

In order to test we need to download XLSX file from the Internet:

wget -O test.xlsx https://raw.githubusercontent.com/dilshod/xlsx2csv/master/test/xlsx2csv-test-file.xlsx

Now run the xlsx2csv command to convert XLSX file to CSV file:

xlsx2csv test.xlsx test.csv

We can check the content of the CSV file:

cat test.csv
A,B,C
,MSP,
,MSP,
...........
blah,PPS,
blah,PPS,

Results also can be written to standard output without specifying the name of the CSV file as second argument:

xlsx2csv test.xlsx

If the xlsx2csv is no longer needed, you can remove it with command:

sudo apt purge --autoremove -y xlsx2csv

Leave a Comment

Cancel reply

Your email address will not be published.