Move under www to ease rsync
This commit is contained in:
45
www/eps/hpr2238/hpr2238_contacts.awk
Executable file
45
www/eps/hpr2238/hpr2238_contacts.awk
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/awk -f
|
||||
|
||||
#
|
||||
# Define separators
|
||||
#
|
||||
BEGIN{
|
||||
#
|
||||
# The field separator is a newline
|
||||
#
|
||||
FS = "\n"
|
||||
|
||||
#
|
||||
# The record separator is two newlines since there's a blank line between
|
||||
# contacts.
|
||||
#
|
||||
RS = "\n\n"
|
||||
|
||||
#
|
||||
# On output write a line of hyphens on a new line
|
||||
#
|
||||
ORS = "\n----\n"
|
||||
}
|
||||
|
||||
{
|
||||
#
|
||||
# Show where the "beginning of buffer" is
|
||||
#
|
||||
sub(/\`/, "[")
|
||||
|
||||
#
|
||||
# Show where the "end of buffer" is
|
||||
#
|
||||
sub(/\'/, "]")
|
||||
|
||||
#
|
||||
# Show where the start and end of "line" are
|
||||
#
|
||||
sub(/^/, "{")
|
||||
sub(/$/, "}")
|
||||
|
||||
#
|
||||
# Print the buffer with a record number and a field count
|
||||
#
|
||||
print "(" NR "/" NF ")", $0
|
||||
}
|
||||
Reference in New Issue
Block a user