Errors importing bibtex .bib files
I'm trying to get started with zotero, and I have several large .bib files. Every time I try to import one I just get a message that there's an error and I should verify that my bib file is valid.
How should I go about debugging this? I don't see anything to help me figure out where the error is in my bib file, and AFAICT zotero just throws the whole file on the floor when it fails to parse, so I don't see any prefix of the file that was successfully processed. I looked at the debug log, too, but there's nothing in there that jumps out at me, either.
Sorry -- this seems like it's a FAQ, but Google isn't helping me find previous answers.
BTW, I'm using the Better Bibtex plugin.
How should I go about debugging this? I don't see anything to help me figure out where the error is in my bib file, and AFAICT zotero just throws the whole file on the floor when it fails to parse, so I don't see any prefix of the file that was successfully processed. I looked at the debug log, too, but there's nothing in there that jumps out at me, either.
Sorry -- this seems like it's a FAQ, but Google isn't helping me find previous answers.
BTW, I'm using the Better Bibtex plugin.
So I'm just asking what I hope is a simple question: assuming that I have a bib file that is buggy from the PoV of Zotero, how do I localize the bugs?
Thanks!
The last item in the debug log that showed a string I could recognize seemed to refer to this entry in the import file:
@incollection{McCarthy:69,
author = {John McCarthy and Patrick J. Hayes},
booktitle = {Machine Intelligence},
volume = 4,
address = {Edinburgh},
year = {1969},
editor = {B. Meltzer and D. Michie},
publisher = {Edinburgh University Press},
title = {Some philosophical problems
from the standpoint of artificial intelligence}
}
but that's pretty much a wild guess. If it would help, please contact me, and I will send you the bibtex file.
@dstillman could you check the debug?
But if this were me, I'd do the binary search for problems as Dan suggests above. My recollection is that Zotero doesn't do good logging about where exactly in a file it fails.
Given how crufty hand-written bib files are, I'm actually surprised that there aren't more problems like mine. bibtex will typically run at least kind of ok against files with errors in them...
I have 66K lines of .bib (not all in one file, but still) acquired over something like 25 years, so the option of debugging by binary search seems pretty painful to me. This is only one error; I have no way of estimating how many times I'd have to repeat the binary search.
@techreport(McDermott:72,
author = MCDERMOTT # { and Gerald J. Sussman},
year = {1972},
month = May,
institution = {MIT Artificial Intelligence Laboratory},
title = {The {\sc CONNIVER} Reference Manual}
)
That's legitimate bibtex, but it seems like it could blow up an importer, and indeed this causes what looks like the same hang when I put it in a file by itself.
This is actually a difficult issue for Bibtex import, because it's quite normal to do something like this, and it's not required to have the string definitions in the same file (indeed, for some abbreviations you wouldn't *want* to have them in the same file, because you would want to expand journal names, for example, differently in conference papers -- abbreviate -- and journal articles -- write out in full).
So this seems to be the problem. I could see that Zotero might not be able to import these, but it seems like a bug that it causes it to hang.
I can't look at this at the moment, but someone more familiar with the BibTeX translator might have more to say on it. Obviously this shouldn't cause a hang regardless, so at the very least this should stop the import with an error.
Possibly stupid question: is there some reason the bibtex importers couldn't count input file lines?
@rpgoldman: thanks, I'll look into that.
With BBT, I get an error message, and *nothing* is imported.
In both cases, it would be great to have a line count in the error window to help debug.