1

OS: macOS, Sierra

I want to analyse a large (5000 entries) bibtex file in R statistically to look at the years published, Journals, Authors, ...

There is an R package for reading bibtex files, but it collapses with larger bibtex files (and it gives strange error messages with smaller ones sometimes...).

So I am looking for a command line tool to extract certain fields from the bibtex file or to convert it to a csv or similar format.

My idea would be to have a tool which takes the bibtex file as an input parameter and returns certain fields or converts it to a more easily parsable format (csv, sqlite, ...). I could then read the values directly into R or from the created csv / sqlite / ...

Is there something out there? Any suggestions how I could do the analysis?

I could use e.g. Jabref to convert, but would prefer a command line approach.

  • Well, Biber can already do a lot of manipulations of .bib entry data, including outputting only specific fields, outputting to XML. It could be combined (say) with grep and sed at the very least to create a .csv. Biber itself might be able to do it all on its own, but I've never looked into it. I just ran as a test biber --tool --output-macro-fields=journal,journaltitle bibliography.bib which is 38,000 lines long. It stripped the braces from the journal and journaltitle fields (resulting in lines line JOURNALTITLE = Ethics, in the file bibliography_bibertool.bib). – jon Dec 7 '16 at 18:27
  • 1
    Write a script? I have a small python routine that converts bib to csv... – Thruston Dec 8 '16 at 19:29
-1

Sorry, I did not see your final line mentioning Jabref and saying you would prefer a command line approach. However, I will leave this here for others who may find it useful.

I am looking to do something similar, and am using Jabref. It is able to export to CSV, as well as other formats.

It also has a dialogue for quality control, e.g. stripping braces or converting LaTeX to unicode. Quality -> Clean up entries

https://www.jabref.org/

Not affiliated with JabRef, but I do use it.

  • 1
    Welcome to LaTeX! Can I just ask, are you affiliated in any way with the product? Because if you are, you must mention this in the answer, as specified here - How to not be a spammer. Thanks! – CalvT Jan 9 '18 at 16:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.