From 2ce11716fa4d03e2d8110dcafef36c7a6518c719 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 19 Mar 2023 21:31:08 +0200 Subject: Update man page and ref card for --csv option. --- doc/ChangeLog | 5 +++++ doc/awkcard.in | 14 ++++++++------ doc/gawk.1 | 20 ++++++++++++++++++++ 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 3df4953d..238a1800 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2023-03-19 Arnold D. Robbins + + * awkcard.in: Document -k/--csv. + * gawk.1: Ditto, add short section on CSV handling. + 2023-03-09 Arnold D. Robbins * gawkworkflow.texi (UPDATE-MONTH, EDITION): Updated. diff --git a/doc/awkcard.in b/doc/awkcard.in index ff55c1b5..ff403e99 100644 --- a/doc/awkcard.in +++ b/doc/awkcard.in @@ -275,6 +275,8 @@ Include library AWK code in \*(FIfile\*(FR. See \fHAwk Program Execution\*(FR. .TI "\*(FC\-I\*(FR, \*(FC\-\^\-trace\*(FR Print the internal byte code names as they are executed. +.TI "\*(FC\-k\*(FR, \*(FC\-\^\-csv\*(FR +Enable CSV special processing. See the manual for details. .TI "\*(FC\-l \*(FIlib\*(FR, \*(FC\-\^\-load \*(FIlib\*(FR Load dynamic extension \*(FIlib\fP. See \fHDynamic Extensions\*(FR. @@ -302,9 +304,7 @@ Send profiling data to \*(FIfile\*(FR (default: \*(FCawkprof.out\*(FR). The profile contains execution counts in the left margin. .TI "\*(FC\-P\*(FR, \*(FC\-\^\-posix\*(FR -Disable common and GNU extensions. -.TI "\*(FC\-r\*(FR, \*(FC\-\^\-re\-interval\*(FR -Does nothing; for backwards compatibility only.\*(CB +Disable common and GNU extensions.\*(CB .in -4n .EB "\s+2\f(HBCOMMAND LINE ARGUMENTS (\*(GK\f(HB)\*(FR\s0" @@ -316,6 +316,8 @@ Does nothing; for backwards compatibility only.\*(CB .ES .fi .in +4n +.TI "\*(FC\-r\*(FR, \*(FC\-\^\-re\-interval\*(FR +Does nothing; for backwards compatibility only. .TI "\*(FC\-s\*(FR, \*(FC\-\^\-no\-optimize\*(FR Disable internal optimizations. .TI "\*(FC\-S\*(FR, \*(FC\-\^\-sandbox\*(FR @@ -405,9 +407,9 @@ Either the pattern or the action may be missing, but not both. If the pattern is missing, the action is executed for every input record. A missing action is equivalent to -.sp .5 - \*(FC{ print }\fP -.sp .5 +.\" .sp .5 +\*(FC{ print }\fP +.\" .sp .5 which prints the entire record. .sp .5 Comments begin with the \*(FC#\*(FR character, and continue until the diff --git a/doc/gawk.1 b/doc/gawk.1 index c5cbe87d..eb5980d5 100644 --- a/doc/gawk.1 +++ b/doc/gawk.1 @@ -234,6 +234,12 @@ is preceded by a .B + sign in the output. .TP +\fB\-k\fR, \fB\-\^\-csv\fR +Enable CSV special processing. +See the manual for details. +.BR FIXME : +eventually provide a URL here. +.TP .BI \-l " lib\fR, "\c .BI \-\^\-load " lib" Load a @@ -638,6 +644,20 @@ Similarly, assigning a value to .B $0 causes the record to be resplit, creating new values for the fields. +.SS Comma Separated Values +When invoked with the +.B \-\^\-csv +option, +.I gawk +does not use regular record determination and field splitting +as described above. +Instead, records are terminated by unquoted newlines, and +fields are separated by commas. +Double-quotes may be used to enclose fields containing +commas, newlines, or doubled double-quotes. +See +.B FIXME +in the manual for more detail. .SS Built-in Variables .IR Gawk\^ "'s" built-in variables are listed below. -- cgit v1.2.1