Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open xlsx with vim [closed]

I'm frequently getting .xslx files and do not have the newest Excel to open. Open Office takes too long to open them as does converting software for older Excel versions.

So, I want to open the xlsx file using vim (or maybe notepad++). However, apparently it is not stored as standard text, so trying to open it results in random characters.

Is there some way I can get vim or Notepad++ (or some other text editor) to open an XLSX file?

like image 778
David Starkey Avatar asked Jul 16 '13 21:07

David Starkey


People also ask

How do I open a xls file in Terminal?

Search the “sample file. xlc” file and click on the “Open” button located at the top right corner. And the excel file “sample file. xlc” will be opened, and it will display all the file data in the “LibreOffice Calc” app.

How can I open XLSX file in Notepad ++?

How to open an Excel file in Notepad++? You need to save your file in CSV format and then afterwards, open it via Notepad++. Open Notepad++ and change the file type of all and then browse to your file and open.


1 Answers

XLSX is just a zip of a bunch of XML files, so you could unzip them and view the XML, but that isn't going to get you very far, because the XML itself is not all that easy to read. My experience with it isn't extensive, but basically, in worksheets with formulas and numbers, you'll see an XML file for each sheet, containing an element for each cell with information about the cell and what it contains (<f> tags for functions, v for value), except if the cell contains a string, the value is a number referencing it to sharedStrings.xml, which contains basically a list of all unique strings in the entire workbook. I don't see an easy way to just open it up and read the contents the way you seem to want to.

It's possible that converting the xlsx file to something simple like CSV may be faster than trying to convert it to xls, which is a different binary format, but I don't know. Another option is rolling your own conversion program using something like Perl's Spreadsheet::XLSX. I don't know how much this will help you, but hopefully you can get enough information from this to know where to look next.

like image 178
Jeremy Avatar answered Oct 31 '22 10:10

Jeremy