GNU-devel ELPA - csv-mode

csv-mode Atom Feed

Description
Major mode for editing comma/char separated values
Latest
csv-mode-1.27.0.20240816.74202.tar (.sig), 2024-Aug-16, 100 KiB
Maintainer
<emacs-devel@gnu.org>
Website
https://elpa.gnu.org/packages/csv-mode.html
Browse ELPA's repository
CGit or Gitweb
Badge

To install this package from Emacs, use package-install or list-packages.

Full description

This package implements CSV mode, a major mode for editing records
in a generalized CSV (character-separated values) format.  It binds
files with prefix ".csv" to `csv-mode' (and ".tsv" to `tsv-mode') in
`auto-mode-alist'.

In CSV mode, the following commands are available:

- C-c C-s (`csv-sort-fields') and C-c C-n (`csv-sort-numeric-fields')
  respectively sort lexicographically and numerically on a
  specified field or column.

- C-c C-r (`csv-reverse-region') reverses the order.  (These
  commands are based closely on, and use, code in `sort.el'.)

- C-c C-k (`csv-kill-fields') and C-c C-y (`csv-yank-fields') kill
  and yank fields or columns, although they do not use the normal
  kill ring.  C-c C-k can kill more than one field at once, but
  multiple killed fields can be yanked only as a fixed group
  equivalent to a single field.

- `csv-align-mode' keeps fields visually aligned, on-the-fly.
  It truncates fields to a maximum width that can be changed per-column
  with `csv-align-set-column-width'.
  Alternatively, C-c C-a (`csv-align-fields') aligns fields into columns
  and C-c C-u (`csv-unalign-fields') undoes such alignment;
  separators can be hidden within aligned records (controlled by
  `csv-invisibility-default' and `csv-toggle-invisibility').

- C-c C-t (`csv-transpose') interchanges rows and columns.  For
  details, see the documentation for the individual commands.

- `csv-set-separator' sets the CSV separator of the current buffer,
  while `csv-guess-set-separator' guesses and sets the separator
  based on the current buffer's contents.
  `csv-guess-set-separator' can be useful to add to the mode hook
  to have CSV mode guess and set the separator automatically when
  visiting a buffer:

    (add-hook 'csv-mode-hook 'csv-guess-set-separator)

CSV mode can recognize fields separated by any of several single
characters, specified by the value of the customizable user option
`csv-separators'.  CSV data fields can be delimited by quote
characters (and must if they contain separator characters).  This
implementation supports quoted fields, where the quote characters
allowed are specified by the value of the customizable user option
`csv-field-quotes'.  By default, the both commas and tabs are considered
as separators and the only field quote is a double quote.
These user options can be changed ONLY by customizing them, e.g. via M-x
customize-variable.

CSV mode commands ignore blank lines and comment lines beginning
with the value of the buffer local variable `csv-comment-start',
which by default is #.  The user interface is similar to that of
the standard commands `sort-fields' and `sort-numeric-fields', but
see the major mode documentation below.

The global minor mode `csv-field-index-mode' provides display of
the current field index in the mode line, cf. `line-number-mode'
and `column-number-mode'.  It is on by default.

See also:

the standard GNU Emacs 21 packages align.el, which will align
columns within a region, and delim-col.el, which helps to prettify
columns in a text region or rectangle;

csv.el by Ulf Jasper <ulf.jasper at web.de>, which provides
functions for reading/parsing comma-separated value files and is
available at http://de.geocities.com/ulf_jasper/emacs.html (and in
the gnu.emacs.sources archives).

Old versions

csv-mode-1.27.0.20240814.110630.tar.lz2024-Aug-1421.1 KiB
csv-mode-1.27.0.20240809.72715.tar.lz2024-Aug-0921.1 KiB
csv-mode-1.26.0.20240804.143344.tar.lz2024-Aug-0421.0 KiB
csv-mode-1.20.0.20220514.70912.tar.lz2022-May-1420.2 KiB
csv-mode-1.19.0.20220512.195325.tar.lz2022-May-1220.0 KiB
csv-mode-1.18.0.20220323.163151.tar.lz2022-Mar-2318.6 KiB
csv-mode-1.17.0.20211219.90818.tar.lz2021-Dec-1918.5 KiB
csv-mode-1.16.0.20210910.112709.tar.lz2021-Sep-1018.4 KiB
csv-mode-1.15.0.20210223.154950.tar.lz2021-Feb-2318.4 KiB
csv-mode-1.14.0.20201209.140747.tar.lz2020-Dec-1418.2 KiB

News

Since 1.27:
- `csv-end-of-field' no longer errors out in the presence of
   unclosed quotes.

Since 1.26:
- `csv-guess-separator' will no longer guess the comment-start
   character as a potential separator character.

Since 1.25:
- The ASCII control character 31 Unit Separator can now be
  recognized as a CSV separator by `csv-guess-separator'.

Since 1.24:
- New function `csv--unquote-value'.
- New function `csv-parse-current-row'.

Since 1.21:
- New command `csv-insert-column'.
- New config var `csv-align-min-width' for `csv-align-mode'.
- New option `csv-confirm-region'.

Since 1.20:
- New command `csv-guess-set-separator' that automatically guesses
  and sets the CSV separator of the current buffer.
- New command `csv-set-separator' for setting the CSV separator
  manually.

Since 1.9:
- `csv-align-mode' auto-aligns columns dynamically (on screen).

Before that:
Begun on 15 November 2003 to provide lexicographic sorting of
simple CSV data by field and released as csv.el.  Facilities to
kill multiple fields and customize separator added on 9 April 2004.
Converted to a major mode and renamed csv-mode.el on 10 April 2004,
partly at the suggestion of Stefan Monnier <monnier at
IRO.UMontreal.CA> to avoid conflict with csv.el by Ulf Jasper.
Field alignment, comment support and CSV mode customization group
added on 1 May 2004.  Support for index ranges added on 6 June
2004.  Multiple field separators added on 12 June 2004.
Transposition added on 22 June 2004.  Separator invisibility added
on 23 June 2004.