aboutsummaryrefslogtreecommitdiffstats
path: root/cppawk-iter.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-04-23 18:22:53 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-04-23 18:22:53 -0700
commitcf6bf82e912743716160c72702b1b6a6b63c0770 (patch)
tree04edd3595c3dd7ed552b345ad0e730f1d0004ebf /cppawk-iter.1
parentb700e8e335f9e6ebf31457262db323273e339afa (diff)
downloadcppawk-cf6bf82e912743716160c72702b1b6a6b63c0770.tar.gz
cppawk-cf6bf82e912743716160c72702b1b6a6b63c0770.tar.bz2
cppawk-cf6bf82e912743716160c72702b1b6a6b63c0770.zip
loop: new records clause.
Diffstat (limited to 'cppawk-iter.1')
-rw-r--r--cppawk-iter.135
1 files changed, 35 insertions, 0 deletions
diff --git a/cppawk-iter.1 b/cppawk-iter.1
index 490c9cb..b45cd30 100644
--- a/cppawk-iter.1
+++ b/cppawk-iter.1
@@ -77,6 +77,7 @@ iter \- powerful, user-extensible iteration language for Awk
list (\fIiter\fP, \fIvar\fP, \fIlist\fP)
fields (\fIvar\fP)
keys (\fIkey\fP, \fIarray\fP)
+ records (\fIfile\fP)
\fI// collect items into lists\fP
collect (\fIvar\fP, \fIexpr\fP)
@@ -684,6 +685,40 @@ parameter. The
variable is set to each index in turn. The keys are not visited in
any specific, required order.
+.SS Loop clause \fIrecords\fP
+.bk
+.B Syntax:
+
+.ft B
+ records (\fIfile\fP)
+.ft R
+
+.B Description:
+
+The
+.B records
+clause is based on the Awk
+.B getline
+operator. The
+.I file
+expression is evaluated once, prior to the loop, and its value is
+remembered. Then prior to each iteration of the loop, a record is
+read from the file using
+.B getline
+which has the effect of setting the record parameter
+.B $0
+and the positional parameters
+.BR $1 ,
+.BR $2 ", ..."
+in the manner documented of the
+.B getline
+operator.
+
+When the loop terminates normally, the file is closed, unless
+it is the string
+.B \(dq-\(dq
+denoting standard input.
+
.SH LOOP CLAUSES: COLLECTION INTO LISTS
.bk
.SS Loop clauses \fIcollect\fP and \fIcollect_plus\fP