Is there a good emacs mode for displaying and editing huge delimiter separated files?

unhammer picture unhammer · May 16, 2012 · Viewed 13.5k times · Source

I've been searching without finding for a while for a mode that makes editing huge tab/comma/colon-separated files easy. I've been wanting a mode that ensures that columns always line up, just like org-mode tables. I know I can easily turn the whole file into an org-mode table and then turn it back when I'm done, but that gets really slow with huge files, and is a hassle for quick edits (there's also the problem of what happens if a field contains a vertical bar). So does anyone know of either a mode or a built-in function/variable I can use so that I can get a file like

col1\tcol2\tcol3
very long column1\tcol2\tcol3

displayed like

col1               col2  col3
very long column1  col2  col3

? (perhaps with some color lining the separator)

Answer

phils picture phils · May 16, 2012

Perhaps you could tell us what you've already found and rejected?

If you've been searching, then you must surely have seen http://emacswiki.org/emacs/CsvMode ? You don't mention it, or say why it wasn't any good, though.

SES (Simple Emacs Spreadsheet) might be a useful approach:

C-hig (ses) RET

You can create a ses-mode buffer and yank tab-delimited data into it (that's the import mechanism).

It's probably more hassle than you were after, though, and I'm not sure how well it will perform with "huge" files.