9/07/2007

Using awk with multiline records

To print the first field of a multiline record:

awk 'BEGIN {RS = ""} {print $1}'


If you want each line to be one field in the multiline record:

awk 'BEGIN { FS= "\n"; RS = "" } {print $1}'

No comments: