Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to add missing fields and prevent duplicates #50

Open
kirk86 opened this issue Nov 26, 2018 · 1 comment
Open

how to add missing fields and prevent duplicates #50

kirk86 opened this issue Nov 26, 2018 · 1 comment
Assignees

Comments

@kirk86
Copy link

kirk86 commented Nov 26, 2018

Hi @ge-ne,
thanks a lot for sharing bibtool.
If you don't mind me asking here a couple of questions which I've searched over on google but was unable to find some coherent examples.

My use case contains of creating .bib files for my work and occasionally merge them to a bigger .bib file. The citekeys I use are of the following pattern author_year_unique_consecutive_letter, without the underscores.

Example:

doe2018
doe2018b
doe2018c
doe2018d
etc...

I would like eventually to achieve the following when merging .bib files to the main bigger one.

  1. search all entries and if there's a missing field such as for instance journal then add a user defined text

I tried the following command looking at the manual but seems not to produce the desired output.
bibtool 'add.field={journal="(journal){%N(journal)}{--no-journal--}"}' ./biblio.bib

  1. before merging everything to the bigger .bib file check for duplicate entries, meaning find entries where they have the same key and same title and resolve those by deleting the excessive entries, in the case where there's only duplicate keys but the titles among those entries are different then extract those entries and dump them in an additional file called duplicates for manual inspection, avoiding merging them altogether in the bigger .bib file.

Thanks!

@ge-ne ge-ne self-assigned this Nov 26, 2018
@ge-ne
Copy link
Owner

ge-ne commented Nov 26, 2018

Ad 1: I can reproduce your example. A first analysis has lead me to the conclusion that only a subset of the formatting instructions is evaluated for add.field. I will need to perform a deeper analysis in order to explain or fix the behaviour.

Ad 2: See resource check.double.
Double entries are identified if their sort key is identical. In this case the duplicate is deactivated by printing ### instead of @. This can be used for inspection. The resource check.double.delete can be set to delete the duplicates instead of deactivating them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants