These 5 Linux command-line instruments allow you to work with Excel spreadsheets from the terminal

There are many open-source alternatives to Microsoft Excel, however well-liked Linux choices like LibreOffice Calc and Gnumeric are strictly GUI apps. So what’s on the market for the command-line fan who must crunch numbers? Let’s discover out!
Sheets
A terminal-based spreadsheet instrument that permits you to edit CSV information
This first instrument is by far the only on my record and, to be sincere, it’s a little bit of a cheat. Sheets doesn’t work with information in Excel’s XLSX format, however reasonably its extra fundamental cousins, the CSV. A CSV file contains plain-text data, with none formulation, however Excel has sturdy assist for this format, so it’s usually used to change knowledge.
Sheets is a TUI that permits you to work with a CSV file interactively, shopping its knowledge in rows and columns. In this mode, you may edit knowledge and use acquainted Vim keybindings to navigate, insert knowledge, delete rows, and so forth.
You may also use a command-line mode to, for instance, extract a variety of information:
sheets file.csv C2:C4
You may even use Sheets to change the information in a cell:
sheets file.csv B2=100 C2=330
Another good characteristic is the command’s assist for studying normal enter. Using this, you may assemble CSV-formatted knowledge in a command chain, then pipe it to sheets to discover the outcomes.
excelchop
A command-line utility to extract knowledge from Microsoft Excel information
Like Sheets, excelchop additionally helps you to extract knowledge from the command line. This time, nonetheless, that’s your entire focus of this system, however there’s an upside: excelchop works with full Excel spreadsheet information, not simply CSVs.
As the identify suggests, it’s purely for extracting knowledge, so for those who’re engaged on a undertaking that should settle for Excel information as a knowledge supply, it’s preferrred. By default, excelchop will convert a file into plain textual content knowledge and output it with tabs between every column and newlines between every row. You can use a easy syntax to extract a variety of information as a substitute:
excelchop -r B7:D9 file.xlsx
excelchop helps the trendy open normal, XLSX, however not the older proprietary XLS format.
xleak
A quick terminal Excel viewer with an interactive TUI
The xleak program combines assist for Excel information, a default ASCII-art view of information on the command-line, and an interactive TUI. It’s purely for viewing knowledge, however its dual-mode method makes it versatile, and the app may be very quick.
xleak follows the Unix custom of easy instruments with a slim scope, executed effectively. It helps a fundamental set of features like search, copying knowledge, and biking by means of a small set of themes. Everything is keyboard-driven, with a helpful shortcut cheat sheet accessible through the ? key.
There’s restricted assist for filtering in xleak; you may prohibit it to indicate a most variety of rows, however that’s about it. Overall, it is a instrument that’s finest suited to exploring knowledge in a gorgeous interface reasonably than finishing up extra superior duties. Best of all, xleak helps the older XLS file format.
VisiData
An interactive multipurpose instrument for tabular knowledge
This app’s identify additionally describes what it does fairly precisely: it visualizes knowledge. While VisiData excels at knowledge exploration and evaluation, it’s also possible to use it to view, edit, and summarize knowledge with an enormous array of options.
As quickly as you open VisiData, you’ll discover that it’s a TUI app in essentially the most highly effective sense: colours, menus, and full mouse assist are all current. There’s even a popup-style assist window within the backside proper with suggestions and shortcuts.
VisiData actually delivers relating to knowledge evaluation and visualization. For instance, choose a column, press Shift + F, and also you’ll immediately see a abstract desk, full with a histogram. The app is surprisingly full-featured, with good assist for giant information, dealing with of many different codecs (like JSON or SQLite databases), and saving of your filtered/sorted knowledge.
Vex
A terminal-based editor for Excel and CSV information
If you’re searching for a pleasant TUI with assist for filtering and the power to make edits, look no additional than Vex. It could not have the superior visualization options of VisiData, however whenever you truly need to change the contents of an Excel spreadsheet out of your terminal, it’s the perfect wager.
This is one other instrument that makes good use of keybindings, mirroring common vim commands like dd to delete a row and i to insert knowledge. You may also toggle the show of shortcuts on the underside 4 rows of your terminal; these develop intelligently to take up the accessible width.
Vex advertises assist for the XLS format, however I discovered an error once I tried to open a pattern file that xleak handles completely. Research suggests it is a flaw within the underlying Go library, so it’s unlikely to be fastened within the close to future.
Plenty of alternative for a variety of wants
There are loads of open-source instruments accessible for a wide range of Excel-based duties, from utilizing knowledge in a script to enhancing it instantly in an interactive app. Like many different areas of labor, TUIs can be a wonderful option, offered you’re conscious of them.
