I'm trying to export from JabRef to a CSV using a custom layout file. Some of the text for my fields contains double quote marks ("), which breaks the encasing quotes early and any subsequent commas move text to the next field in Excel. It is very important that the data is in the correct columns as it will be ingested elsewhere after. Is there an escape character so that I can replace the double quotes with something else so that it no longer breaks?

Currently this is what I have for one of the problem fields, trying to replace the double quotes with single quotes. However this just ends up printing everything after the double quotes (without the Replace function the rest of the layout file works fine).

previousField,"\format[Replace(",'),FormatChars,RemoveLatexCommands]{\abstract}", nextField

I have tried various escape characters I can think of (/,\,',"").

The simple answer of course is to remove all double quotes from the source text, but I don't have total control over it and can't guarantee that it will happen.

  • I think you have to use the java escape style here, so a combination of backlash + double quote, \“ should work Aug 23 '17 at 22:01
  • I tired that and it didn't work. I think for some reason it is matching to the double quotes before the format call, even though that should just be regular text that gets written out.
    – kat
    Aug 25 '17 at 2:41

With JabRef 4.3.1, this code works for me:

previousField,"\format[Replace("",')]{\abstract}", nextField

To add some example, you can replace all newline characters and double quote like this:

"\format[Replace(\r\n, ),Replace(\n, ),Replace(\r, ),Replace("",')]{\abstract}"

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.