I'm seeking a way to get my books database, stored on Goodreads, into BibTeX form. As near as I can tell, Goodreads provides no support for this directly, but does provide for CSV export (on the right). Are there tools I could used to import from the CSV file into BibTeX?

@TorbjørnT.: That has possibilities; but ideally I'd like to avoid writing Java code.
–
raxacoricofallapatoriusMar 18 '12 at 21:48

1

I would write a small AWK script to do that. You can probably equally easy accomplish the task using Tcl, Perl, Python, or Ruby (I know Python and barely some Perl). I would definitely not use JabRef and I would refuse to program in Java even if you point a gun into my my head.
–
Predrag PunosevacMar 19 '12 at 4:53

Below, I give example file of my thesis .bib bibliography, converted to the correct .xmlMODS format by bib2xml and coverted back to a .bib file by xml2bib. It illustrates how complicated the XML format is:

I apologize for the long file listings but I don't have a reliable online file storage.

Now: The following is an input file with header and one bibliography item (containing for each field the filed name with abc...xyz dummy text). I believe that the output XML file could be converted into the MODS format, but I'm not sure how and it will be a lot of work. The why that I thought of is replacing each string of the form <Title> to the string of XML markups that stands before the Title in the correct format.

Zotero
I do not use Goodreads, but I suggest that you try Zotero, and see if Zotero can import directly. Maybe it is able to fetch all your books directly in one operation. Zotero standalone works with different browser and on different platforms.

Try it, it is free so you do not waste any money.

MarcEdit + Bibutils
A two step solution is using MarcEdit: You can import a delimited file (f.ex. CSV) directly. Then it is just to save it to any suitable format supported by your .bib-file manager. If you need to clean up or manipulate the CSV-files, you can use Sam Franche’s CSVed.

Complete solution: Import your CSV-files into MarcEdit. Save as MODS-file. You can then use bibutils to convert from MODS-format into bibtex, as recommended by tohecz.

You can also import a MODS-file exported from MarcEdit into Zotero, clean it up and export it to bibtex-format.

JabrefJabref can import several formats, but I am not absolute sure any of those can be exported from MarcEdit. JabRef also read from SQL databases (MySQL etc). You can import your CSV-files into a MySQL table, let JabRef import it and export it as an .bib-file.

Since the CSV has an ISBN for each book, and since all of the information I need for BibTeX can be reconstructed from the ISBN, all I need to do is use the ISBN column from the CSV to create an array, and then generate a file containing the corresponding BibTeX information:

#!/bin/bash
#Generate a BibTeX bibliography from an array of ISBNs
array=(<pasted column of ISBNs>)
rm goodreads.bib
for isbn in "${isbnarray[@]}"
do
curl http://manas.tungare.name/software/isbn-to-bibtex/isbn-service?isbn=$isbn >> goodreads.bib
done

Your question was how to convert a CSV-file. You did not inform that all record had ISBN-numbers. And how to handle books not on Amazon? MarcEdit is also capable to recreate you bibliography base on a list of ISBN-number, by using the z39.50 protocol and similar, and an open catalogue server (most big libraries). But that was not a complete solution, because it assumed all records had ISBN and eventually not all fields can be recreated (personal notes, etc.).
–
SveinungMar 20 '12 at 7:55