4 ms·
Can anyone recommend a command line tool for manipulating Excel files, that runs on macOS? Edit: I’m looking for a command line tool that allows me to open an
by stevoski 9y ago
Can anyone recommend a command line tool for manipulating Excel files, that runs on macOS?
Edit: I’m looking for a command line tool that allows me to open an Excel file, make a few simple changes, and then save again as an Excel file.
- paulsutter 9y agoPython is one easy / flexible way to wrangle Excel files
- vram22 9y agoYes, there are multiple Python libraries for wrangling Excel files as well as good built-in CSV support via the stdlib's csv module - which, despite its name, can actually support DSV (Delimited Separated Values), which is a generalization of CSV. The csv module also has a dialects feature with attributes like settable delimiters (which is how you get the DSV support) and quoting. And since Python's built-in data structures like lists, dicts, tuples and sets are great for munging data, you can get a lot done with just that, plus the benefit of Python's readability and productivity.
- jwdunne 9y agoRuby has a great gem too. I used it to migrate a client's membership data from an excel spreadsheet to a SQL data model. This sheet was formatted like: MEMBERS ...rows... ADMINS ...rows... EXECUTIVE COMMITTEE ...rows... You could whip up any command line tool you need with that.
- deleted 9y ago[deleted]
- gwn7 9y agoTry visidata. https://github.com/saulpw/homebrew-vd https://github.com/saulpw/homebrew-vd
- reificator 9y agoWhat an unfortunate choice of repository name. I definitely do not want to get Homebrew VD.
- clarkdave 9y agoIf you don’t mind converting the Excel file to CSV, csvkit[0], which is mentioned in the list, has a tool to pipe Excel into CSV for further processing by its sibling tools. It won’t help if you need to retain anything Excel specific, but I find it very useful to deal with any Excel files that come my way. [0] https://csvkit.readthedocs.io/en/1.0.3/ https://csvkit.readthedocs.io/en/1.0.3/
- geocar 9y agoxlsx files are also zipfiles that contain xml, so you might get away with just unzipping them, then using some xml query, then zipping it back up.
- deleted 9y ago[deleted]
- chrisweekly 9y agohttps://github.com/SheetJS/js-xlsx https://github.com/SheetJS/js-xlsx is a solid choice for that kind of thing.