EXCEL FILE MANIPULATION IN LINUX

Nkugwa Mark William
2 min readFeb 13, 2023

--

Excel file manipulation using shell scripting in Linux involves using various shell commands and utilities to perform operations on Excel files. These operations could range from reading data from an Excel file, modifying the contents of an Excel file, or even generating new Excel files.

There are several tools that can be used for Excel file manipulation in Linux, including awk, sed, and csvkit.

One of the most commonly used tools for Excel file manipulation in Linux is awk. Awk is a powerful programming language that provides a wide range of capabilities for manipulating text and data files. When used in conjunction with Excel files, awk can be used to extract specific columns, filter data based on specific conditions, and perform various calculations on the data.

For example, the following awk command can be used to extract the first column of data from an Excel file:

awk -F, '{print $1}' filename.xlsx

Another useful tool for Excel file manipulation in Linux is sed. Sed is a stream editor that can be used to perform various operations on text files, including Excel files. With sed, you can search and replace specific text within an Excel file, or extract specific lines or columns of data.

For example, the following sed command can be used to extract the first column of data from an Excel file:

sed 's/,.*//' filename.xlsx

csvkit is another tool that can be used for Excel file manipulation in Linux. Csvkit is a suite of command-line utilities for working with CSV (Comma-Separated Value) files. With csvkit, you can perform a wide range of operations on Excel files, including converting Excel files to CSV format, merging multiple Excel files into a single file, and filtering data based on specific conditions.

For example, the following csvkit command can be used to convert an Excel file to a CSV file:

in2csv filename.xlsx > filename.csv

In conclusion, there are several tools that can be used for Excel file manipulation in Linux

--

--

Nkugwa Mark William

Nkugwa Mark William is a Chemical and Process engineer , entrepreneur, software engineer and a technologists with Apps on google play store and e commerce sites