diff --git a/ase/test/awk/negnum.data b/ase/test/awk/negnum.data new file mode 100644 index 00000000..7b65e93c --- /dev/null +++ b/ase/test/awk/negnum.data @@ -0,0 +1,6 @@ +Beth -4.00 0 +Dan 3.74 0 +-Kathy 4.00 10 +Mark 5.00 -20 +Mary -5.50 22 +Susie -4.25 -18 diff --git a/ase/test/awk/unr-001.awk b/ase/test/awk/unr-001.awk new file mode 100644 index 00000000..6eb3de07 --- /dev/null +++ b/ase/test/awk/unr-001.awk @@ -0,0 +1,6 @@ +# use negnum.data +BEGIN { OFS="\t"; } +{ + for (i = 1; i <= NF; i = i + 1) if ($i < 0) $i = -$i; + print; +}