Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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)

like image 528
unhammer Avatar asked May 16 '12 10:05

unhammer


People also ask

What is CSV mode?

CsvMode, csv-mode, is a package by FrancisJWright for editing comma separated value files ( . csv ). From Emacs 24 onwards, csv-mode is available via. Download csv-mode.

How do I use large CSV files?

So, how do you open large CSV files in Excel? Essentially, there are two options: Split the CSV file into multiple smaller files that do fit within the 1,048,576 row limit; or, Find an Excel add-in that supports CSV files with a higher number of rows.

What are the delimiters we can use in CSV files in file handling?

A CSV file stores data in rows and the values in each row is separated with a separator, also known as a delimiter. Although the file is defined as Comma Separated Values, the delimiter could be anything. The most common delimiters are: a comma (,), a semicolon (;), a tab (\t), a space ( ) and a pipe (|).


1 Answers

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.

like image 156
phils Avatar answered Sep 18 '22 20:09

phils