Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spreadsheet mode for emacs for tab-delimited text files

what is the correct way to view and edit tab-delimited text files in emacs, as if they were a spreadsheet?

if I write tsv files in emacs by using C-q TAB, it has the annoying quirk that tabs are not equispaced. It would be nice to be able to edit cells and have emacs automatically realign it so that it appears in a column, similar to table modes. However, I do not want to make a table, I just want to edit a tsv file. I do not see how this can be done with org-mode. Is there a built in mode for this?

for example using org-mode, I can make the tabs appear equispaced, but emacs does not automatically realign the columns when one of the cells gets more text in it. what is the right way to do this?

like image 990
lgd Avatar asked May 13 '15 23:05

lgd


1 Answers

You can use csv-mode, available from GNU ELPA. It supports both comma-separated and TAB-separated format, and is able to properly align columns. Note that the columns won't be automatically resized on-the-fly, instead you'll have to ask Emacs explicitly to re-align columns after you've edited them.

like image 59
Stefan Avatar answered Sep 21 '22 02:09

Stefan