I have exported the bibliography from Zotero in biblatex format. All the references contain a date field, but now year field.
Is there a simple way (a tool, a script etc.) to convert the date field or to append year and month fields?
Example:
@article{kattan_timeseries_2015, title = {Time-series event-based prediction: An unsupervised learning framework based on genetic programming}, journaltitle = {Information Sciences}, author = {Kattan, Ahmed and Fatima, Shaheen and Arif, Muhammad}, date = {2015-04} }
and I want to be
@article{kattan_timeseries_2015, title = {Time-series event-based prediction: An unsupervised learning framework based on genetic programming}, journaltitle = {Information Sciences}, author = {Kattan, Ahmed and Fatima, Shaheen and Arif, Muhammad}, date = {2015-04}, year = {2015}, month = {04} }
Best Answer
This is something Biber can do in its tool mode.
Unfortunately, the solution originally suggested here ceased to work a while ago. Following https://github.com/plk/biber/issues/301 Biber was adjusted so things would work again. The fix will be available in Biber 2.15. For versions in between, I'm afraid I can not offer a simple Biber-based solution. (Maybe
bibtool
can help here.)Biber version 2.15 and above
We need the following config file, called, say,
biber-date.conf
To convert the
date
fields in your.bib
file runFor the example file
augustus.bib
the output (which you can find in
augustus_bibertools.bib
after thebiber --tool --configfile=biber-date.conf augustus.bib
run) isOld versions of Biber
We need the following config file, called say
biber-date.conf
The regular expressions are not particularly elegant, but the first one copies the month position of the
date
field to themonth
field, the second maps the year position to theyear
field.Now you just need to run
biber --tool --configfile=biber-date.conf <yourbibfile>
On the example file
augustus.bib
the output (which you can find in
augustus_bibertools.bib
after thebiber --tool --configfile=biber-date.conf augustus.bib
run) is