Skip to content

Commit 941b6b6

Browse files
committed
command line examples
1 parent 0cffd4d commit 941b6b6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

penultimate.awk

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Penultimate word of a Record
2+
# Example: awk -f penultimate.awk files/lorem.dat
3+
#
24
# Not too much to explain here, NF stores the number of fields in the current record
35
# NF-1 points to field before last and $(NF-1) will be its value.
46
{print $(NF-1)}

record_replace.awk

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# File record substitution
2+
# Example: awk -f record_replace.awk files/lorem.dat
3+
#
24
# Third line must become: This not latin
35
# Fifth: Neither this
46
NR==3{print "This is not latin";next}

0 commit comments

Comments
 (0)