batch editing of links to pdfs?

I have all my pdfs in a directory and I've made links to each pdf. I will need to move them to another directory now. Is it possible to batch edit the links ? They will have the same name but will be in a new directory

  • There is currently no way to batch edit the location of attachment files. There have been several requests for ways to manage attached files in this kind of fashion but I don't think there is any proposed resolution.
  • I know, it's not recommended but would this be possible with a third-party sqlite client?
  • I know, it's not recommended but would this be possible with a third-party sqlite client?
    On Windows or Linux, yes, you could do it with the SQLite REPLACE() function. On OS X, no, not the way linked file paths are currently stored, though we'll likely be changing that.
  • ok thanks for the help.

    Any suggestions on the exact command?

  • Any suggestions on the exact command?
    Something like this should work:

    UPDATE itemAttachments SET path=REPLACE(path, 'C:\Path\To\Old\Dir', 'C:\Path\To\New\Dir');

    You'd want to make a backup copy first, of course, and I'd also recommend doing a SELECT first to make sure you'll be getting what you expect:

    SELECT path AS oldPath, REPLACE(path, 'C:\Path\To\Old\Dir', 'C:\Path\To\New\Dir') AS newPath FROM itemAttachments;
  • Just wanted to thank you very much for these instructions--they saved me (and I'm sure many others) a lot of time.
  • given that 4 years have passed since the last post in this thread, you may want to look further.

    I think zotfile will do this for you.
  • Hi! If I understood correctly I need to introduce the comand mentioned above in the SQLite file named Zotero?
  • You probably want to use Zotfile for this. It accomplishes this sort of movement without messing with the SQL.
  • Zutilo would be another option to bulk edit (the root of) links, depending on what exactly you need. I'd strongly advise against doing anything that involves changing zotero.sqlite
Sign In or Register to comment.