diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-09-25 20:22:27 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-09-25 20:22:27 -0700 |
commit | a58577fba180a08ebc0fcf43be8a99996359966f (patch) | |
tree | 262e90a4ce637ae3f8a35e4412597cd30311c4e2 | |
parent | c5d3b7ca3f2ef8fcf47fc6427487ccf96f1998ce (diff) | |
download | txr-a58577fba180a08ebc0fcf43be8a99996359966f.tar.gz txr-a58577fba180a08ebc0fcf43be8a99996359966f.tar.bz2 txr-a58577fba180a08ebc0fcf43be8a99996359966f.zip |
doc: fconv examples.
* txr.1: New examples for awk macro fconv.
-rw-r--r-- | txr.1 | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -39242,6 +39242,31 @@ The return value of is .codn f . +.TP* Examples: + +.cblk + ;; convert up to first three fields to integer: + (awk ((fconv i i i))) + + ;; convert all fields to floating-point + (awk ((fconv : r :))) + + ;; convert first and second fields to integer + ;; from hexadecimal; + ;; convert last field to integer from octal; + ;; process pairs of fields in between + ;; these by leaving the first element of + ;; each pair unconverted and converting second + ;; to floating-point; + (awk ((fconv x x : - r : o))) + + ;; convert all fields, except the first, + ;; from integer, turning empty strings + ;; and non-integer junk as zero; + ;; leave first field unconverted: + (awk ((fconv - : iz))) +.cble + .coNP Examples of @ awk Macro Usage The following examples are .code awk |