table-capture

table-capture is an interactive autoloaded compiled Lisp function in `table.el'.

It is bound to <menu-bar> <tools> <Table> <Capture Region>.

(table-capture BEG END &optional COL-DELIM-REGEXP ROW-DELIM-REGEXP JUSTIFY MIN-CELL-WIDTH COLUMNS)

Convert plain text into a table by capturing the text in the region.
Create a table with the text in region as cell contents. BEG and END
specify the region. The text in the region is replaced with a table.
The removed text is inserted in the table. When optional
COL-DELIM-REGEXP and ROW-DELIM-REGEXP are provided the region contents
is parsed and separated into individual cell contents by using the
delimiter regular expressions. This parsing determines the number of
columns and rows of the table automatically. If COL-DELIM-REGEXP and
ROW-DELIM-REGEXP are omitted the result table has only one cell and
the entire region contents is placed in that cell. Optional JUSTIFY
is one of 'left, 'center or 'right, which specifies the cell
justification. Optional MIN-CELL-WIDTH specifies the minimum cell
width. Optional COLUMNS specify the number of columns when
ROW-DELIM-REGEXP is not specified.


Example 1:

1, 2, 3, 4
5, 6, 7, 8
, 9, 10

Running `table-capture' on above 3 line region with COL-DELIM-REGEXP
"," and ROW-DELIM-REGEXP "\n" creates the following table. In
this example the cells are centered and minimum cell width is
specified as 5.

+-----+-----+-----+-----+
| 1 | 2 | 3 | 4 |
+-----+-----+-----+-----+
| 5 | 6 | 7 | 8 |
+-----+-----+-----+-----+
| | 9 | 10 | |
+-----+-----+-----+-----+

Note:

In case the function is called interactively user must use C-q `quoted-insert'
in order to enter "\n" successfully. COL-DELIM-REGEXP at the end
of each row is optional.


Example 2:

This example shows how a table can be used for text layout editing.
Let `table-capture' capture the following region starting from
-!- and ending at -*-, that contains three paragraphs and two item
name headers. This time specify empty string for both
COL-DELIM-REGEXP and ROW-DELIM-REGEXP.

-!-`table-capture' is a powerful command however mastering its power
requires some practice. Here is a list of items what it can do.

Parse Cell Items By using column delimiter regular
expression and raw delimiter regular
expression, it parses the specified text
area and extracts cell items from
non-table text and then forms a table out
of them.

Capture Text Area When no delimiters are specified it
creates a single cell table. The text in
the specified region is placed in that
cell.-*-

Now the entire content is captured in a cell which is itself a table
like this.

+-----------------------------------------------------------------+
|`table-capture' is a powerful command however mastering its power|
|requires some practice. Here is a list of items what it can do. |
| |
|Parse Cell Items By using column delimiter regular |
| expression and raw delimiter regular |
| expression, it parses the specified text |
| area and extracts cell items from |
| non-table text and then forms a table out |
| of them. |
| |
|Capture Text Area When no delimiters are specified it |
| creates a single cell table. The text in |
| the specified region is placed in that |
| cell. |
+-----------------------------------------------------------------+

By splitting the cell appropriately we now have a table consisting of
paragraphs occupying its own cell. Each cell can now be edited
independently.

+-----------------------------------------------------------------+
|`table-capture' is a powerful command however mastering its power|
|requires some practice. Here is a list of items what it can do. |
+---------------------+-------------------------------------------+
|Parse Cell Items |By using column delimiter regular |
| |expression and raw delimiter regular |
| |expression, it parses the specified text |
| |area and extracts cell items from |
| |non-table text and then forms a table out |
| |of them. |
+---------------------+-------------------------------------------+
|Capture Text Area |When no delimiters are specified it |
| |creates a single cell table. The text in |
| |the specified region is placed in that |
| |cell. |
+---------------------+-------------------------------------------+

By applying `table-release', which does the opposite process, the
contents become once again plain text. `table-release' works as
companion command to `table-capture' this way.