# The trick: Set Record Separator to nil, and Field Separator to newline. # This capitalizes on the structure of how JabRef formats the database, where each entry is separated by a newline. # The following command prints the first line of the record, which is the bibtex type field and the entry key. BEGIN{RS=""; FS="\n"} {print $1} # Other possible options: # {print $(NF) # This prints the last line (should be the closing curly bracket) # {print $(NF - 1) # This prints the last field before the closing curly bracket # ($1 ~ "Almeida") {print $0} # This would print all the entries that have "Almeida" as a key.