given on @option{-o} does not end in @file{.csv}.
@item -O separator=@var{field-separator}
-Sets the character used to separate fields. The default is a comma
+Sets the character used to separate fields. Default: a comma
(@samp{,}).
+
+@item -O captions=@var{boolean}
+Whether table captions should be printed. Default: @code{on}.
@end table
The CSV format used is an extension to that specified in RFC 4180:
Each table row is output on a separate line, and each column is output
as a field. The contents of a cell that spans multiple rows or
columns is output only for the top-left row and column; the rest are
-output as empty fields. When a table has a caption, it is output just
-above the table as a single field prefixed by @samp{Table:}.
+output as empty fields. When a table has a caption and captions are
+enabled, the caption is output just above the table as a single field
+prefixed by @samp{Table:}.
@item Text
Text in output is printed as a field on a line by itself. The TITLE
char *separator; /* Field separator (usually comma or tab). */
char *quote_set; /* Characters that force quoting. */
+ bool captions; /* Print table captions? */
+
char *file_name; /* Output file name. */
char *command_name; /* Current command. */
FILE *file; /* Output file. */
csv->separator = parse_string (opt (d, o, "separator", ","));
csv->quote_set = xasprintf ("\"\n\r\t%s", csv->separator);
+ csv->captions = parse_boolean (opt (d, o, "captions", "true"));
csv->file_name = xstrdup (file_name);
csv->file = fn_open (csv->file_name, "w");
csv->n_items = 0;
csv_put_separator (csv);
- if (caption != NULL)
+ if (csv->captions && caption != NULL)
{
csv_output_field_format (csv, "Table: %s", caption);
putc ('\n', csv->file);