PapersApp: bibtex webpages

If you use papers app in combination with bibtex you might have troubles with webpages, because papers app uses some more or less "strange" types and attributes. So I wrote a script to fix it.

The following script will change all @webpage types to @online and adds an attribute named urldate. This attribute is used by biblatex and adds (visited on...) to your bibliography (the date-modified attribute is used to extract this value).

Terminal (Perl)

The following perl command reads the file bibliography/papers.bib, modifies it and writes the output to bibliography/references.bib. So update it with your paths and call it in the terminal:

perl -0777 -pe 's/\@webpage\{([^@]*)date-added([^{]*)([^T]*)T([0-9:A-Z]*)},/\@online\{$1date-modified$2$3T$4},\nurldate=$3},/gsi' bibliography/papers.bib > bibliography/references.bib

Editor (Atom)

If you use an Editor like Atom you can use the build in Find&Replace function: