Files
hpr_website/www/eps/hpr2238/hpr2238_contacts.awk

46 lines
687 B
Awk
Raw Normal View History

2025-10-28 18:39:57 +01:00
#!/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
}