X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcsv.c;h=d168fd9534140230f2e4fb9c15646aa779c0a7e2;hb=5deb8ead72bb5b6058594894bec297768692d780;hp=3fbf53d963448b041d403c81f2e4cd13fe6ad227;hpb=d25ddeb3d3abf24ff017b82184c7bdfb17d2474a;p=pspp-builds.git diff --git a/src/output/csv.c b/src/output/csv.c index 3fbf53d9..d168fd95 100644 --- a/src/output/csv.c +++ b/src/output/csv.c @@ -45,6 +45,8 @@ struct csv_driver 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. */ @@ -80,6 +82,7 @@ csv_create (const char *file_name, enum settings_output_devices device_type, 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; @@ -181,7 +184,7 @@ csv_submit (struct output_driver *driver, csv_put_separator (csv); - if (caption != NULL) + if (csv->captions && caption != NULL) { csv_output_field_format (csv, "Table: %s", caption); putc ('\n', csv->file);