Attach pdf based on the URL field

First, I would like to thank all those who make Zotero, it is a wonderful tool that I've been using for almost 4 years.

I have a library with 900+ references, and each has a link to a PDF stored on my PC. Is there a way to tell Zotero to attach the file linked in the URL field? Doing it individually would take a lot of time!!

Thanks in advance,
  • no, sorry, there isn't.
  • ok, I'll try to find a workaround, and if I succeed I'll post it here.

    Thanks!
  • Depends on that you mean by link. If you have linked files as child items, then you can convert these to stored files using Zotfile. If by link you mean the URL field in the item, then this gets more tricky.

    What you can try is to just drag and drop the files on Zotero, which will make new attachment items. Then use "Retrieve metadata" for the items to recognize them and then removing duplicates will merge them with your existing items. This will not work for all files, but will definitely reduce the amount of manual work that you would need to do.
  • how did the links get in the URL field in the first place? If you imported this via a file format the easiest way would likely be to tweak that process at some stage.
  • @mronkko
    sorry for my ignorance, but I have no idea what "child items" are. I've been playing with Zotfile but I couln't find a way to do what I want. Be sure that I will follow your suggestion before doing it all manually! Thanks

    @adamsmith
    I've been doing it manually, every time I added a reference to the library. Right now, I can't tell you why. I think that I've followed a suggestion that I read in the forum when I migrated my EndNote library to Zotero almost 4 years ago...

    Tomorrow I will investigate if exporting the library, doing some find & replace, and importing it back could do the trick.
  • Child items are items one hierarchy step below a "parent" - e.g. if you add a note to an item it becomes a child note: It becomes visible when you click on the + sign and collapses when you click on -.

    It's possible to add a link to an item as a child item (select an item, click on the paper clip, "attach link to file") If you did that, then mronkko's advice on using Zotfile applies.

    If not, I think export and import may well be your best bet. Depending on your scripting abilities, you'll probably be better off using a simpler format like RIS or Bibtex, though you'll lose some data in the process and collections won't be conserved. Regardless of which export format you use, keep two things in mind:
    1. If you've used your library to write Word/LO documents this will likely break their link to Zotero
    2. If you have used syncing, make sure to disable syncing for the entire process. Then, once you're done re-importing and are sure that everything is fine - and before enabling syncing again - "Restore to Server" from the sync->Reset tab of the Zotero prefes. Otherwise you'll get duplicates for every item.
  • Tomorrow I will investigate if exporting the library, doing some find & replace, and importing it back could do the trick.
    This could work in theory using Zotero RDF format and some regex magic with a decent text editor (e.g. editpad)
  • So yeah, that's contradictory advice for you, but I'll stick by what I said: Doing this with RIS or Bibtex will be much easier.
    But Aurimas is right that Zotero RDF will conserve all your data - but it will require much more thought and indeed very good regexes to not screw things up.
  • For child items, see

    http://www.zotero.org/support/kb/library_items

    The metadata and duplicate strategy that I explain will probably be the easiest option for you. It is unlikely that exporting and importing back will do anything to solve the problem.
  • yeah, so I'll disagree with mronkko here. Export -> Import is going to work much better than dragging all files to Zotero and relying on retrieve metadata and duplicate detection to not mess up.
    E.g. using RIS this could be as simple as search&replacing "UR -" with "L1 -"
  • adamsmith has more experience on this, so I would follow his advice here.
  • Well guys, thank you all for your kind help. It is so late here in Argentina that I wasn't expecting that much feedback today.

    My indea of including pdf's as child items (now I know what it means!) is to bulk rename them using Zotfile.

    I did a quick test exporting references in bib and ris as well as rdf and I think that it can work perfectly. I jut made up a couple of references and replaced UR by L1 and it worked like a charm. I couldn't find an easy way to do it with rdf files. I also looked for missing information and it seems that everything is in place.

    I'm tired and I have no time to do it carefully (I just checked Journal Articles, and not books or chapters), so I'll leave it for tomorrow. But as soon as I can confirm that everything went fine I'll let you know.

    Of course I will follow the recommendations about syncing. Fortunately I am not worried about the LO extension, but that might be important for other users!

    It's 2.30am here and I need to wake up in less than 6 hours so it will be my last post today. Thank you all very much for all your comments and suggestions.
  • any problems let us know.
    Make sure to back up everything:
    http://www.zotero.org/support/zotero_data#backing_up_your_zotero_library
    in case something doesn't work.

This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.

Sign In or Register to comment.