An integrated find and replace option in Zotero?
Would it be possible to construct such a facility in Zotero? It would make life a lot easier. Excuse me if it already exists, but I haven't been able to locate it. Yours Sincerely Erik Schwägermann
An easier-to-use batch editing feature is planned for Zotero in the medium term (I believe the plan is for Zotero 5.2).
In the meantime, I tried following the instructions for batch editing linked above without success. I set the oldValue and newValue to "Escherichia coli" and "<i>Escherichia coli</i>", in order to italicize all instances of the name appearing in titles, but when I run the code it returns "No items found". I tried changing the fieldName to "title", which didn't work either. Any suggestions?
I am using Scratchpad in Browser mode. Zotero 4.0.29.22; Firefox 55.0.3
The script you are currently is likely failing because the sample script you are modifying uses the 'is' match condition, rather than 'contains'. This means that it is looking for titles that are only the words "Escherichia coli", so obviously that won't work. To do what you are hoping to do, you would need to use regular expressions in the search code. So, you would search for 'title' 'contains' 'Escherichia coli', then set newValue to the result of a regex function that returns all of the stuff before "Escherichia coli", the revised "Escherichia coli", and all the stuff after "Escherichia coli".
See the fourth post here for an example of using regex in a Zotero search query:
https://forums.zotero.org/discussion/7707/find-and-replace-on-multiple-items
You can google around for a guide on how to write javascript regular expressions.
Recognizing full-word language descriptions would be basically impossible...
Not really. A parser would need the standard ISO language name (this happens to be in English); the name used by those who use the language (not straightforward because sometimes there may be more than one [but fewer than several]; ISO 639-1; ISO-639-2B; ISO-639-2T; and ISO-639-3. There are no conflicting duplicates. While there will be potential character set / character encoding problems these are likely to be relatively rare.
The vast majority of publishers of books and journals, agencies and NGOs that publish reports, universities that publish theses, and entities that maintain databases all follow their standard (one of the above).
This would only leave us with the problem of publishers that do not provide metadata containing language information. But that is a different issue entirely.
edit: Yes, I'm ignoring regional subtags (en-uk, en-us, fr-ca, etc) but having that info within metadata is rare.