Created
February 12, 2014 12:17
-
-
Save diogo-almeida/8954540 to your computer and use it in GitHub Desktop.
Easy extraction of bibtex entries in databases created by JabRef
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment