Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
kb:exporting_from_endnote_with_pdfs [2009/01/23 14:34] – created ahowardkb:exporting_from_endnote_with_pdfs [2017/11/12 19:53] – external edit 127.0.0.1
Line 1: Line 1:
-=== How do I import my EndNote library, complete with attached PDFs? ===+<html><p id="zotero-5-update-warning" style="color: red; font-weight: bold">We’re 
 +in the process of updating the documentation for 
 +<a href="https://www.zotero.org/blog/zotero-5-0">Zotero 5.0</a>. Some documentation 
 +may be outdated in the meantime. Thanks for your understanding.</p></html> 
 + 
 + 
 +=== [deprecated] How do I import my EndNote library, complete with attached PDFs? === 
 + 
 +**//This procedure is no longer necessary for Zotero 3.0.9. Please refer to [[importing_records_from_endnote|this article]] for help//**
  
 Obviously, manually adding every PDF from a large EndNote library would be rather labor intensive. There is a trick to automating it, though. Obviously, manually adding every PDF from a large EndNote library would be rather labor intensive. There is a trick to automating it, though.
Line 7: Line 15:
 You should be able to import all the PDFs by using a single find and replace statement. In EndNote, you need to export your library using the RIS (Refman) style. It should be exported as a text document. You should be able to import all the PDFs by using a single find and replace statement. In EndNote, you need to export your library using the RIS (Refman) style. It should be exported as a text document.
  
-In it, you will want to find+In it, you will want to replace the 'internal-pdf://' links with 'file://' links. 
 + 
 +On Mac OS X and Linux, you may run:<code bash>sed -e 's/internal-pdf:\/\/.*\//file:\/\/[escaped-path-to-pdfs]\//g' [input.ris] > [output.ris] 
 +</code>(see remark [[kb:exporting_from_endnote_with_pdfs#remark on sed statement|below]]) 
 + 
 +On Windows, you may copy the following and paste it into notepad. Save as "ris-fix.vbs" or similar & run it:<code asp> 
 +' RIS link fixer for windows 
 +' transforms Endnote internal-pdf:// links into file:// links 
 + 
 +Dim FileName, objDialog, boolResult 
 +Dim regEx, FileContents, modFileContents 
 +Dim objShell, pdfFolder 
 + 
 +'choose RIS file 
 +Set objDialog = CreateObject("UserAccounts.CommonDialog"
 +objDialog.Filter = "RIS (*.ris)|*.ris|All Files (*.*)|*.*" 
 +objDialog.FilterIndex = 1 
 +boolResult = objDialog.ShowOpen 
 +If boolResult = 0 Then 
 +  WScript.Quit 
 +Else 
 +  FileName = objDialog.FileName 
 +End If 
 + 
 +'regexreplacement 
 +Set regEx = New RegExp 
 +regEx.Pattern = "internal-pdf://.*/" 
 +FileContents = GetFile(FileName) 
 + 
 +'choose folder containing PDFs 
 +set objShell = CreateObject("Shell.Application"
 +set pdfFolder = objShell.BrowseForFolder(0, "Specify a folder where you have copied all your PDFs...", 0) 
 +If (not pdfFolder is nothing) then 
 +  ReplaceWith  = "file://" + pdfFolder.self.Path 
 +  If (Right(ReplaceWith, 1)<>"\") then  
 +    ReplaceWith = ReplaceWith & "\" 
 +  End If 
 +  regEx.Global = True 
 +  modFileContents = regEx.replace(FileContents, ReplaceWith) 
 +  If modFileContents <> FileContents Then 
 +    WriteFile FileName, modFileContents 
 +    Wscript.Echo "The RIS file has successfully been modified." 
 +  Else 
 +    Wscript.Echo "No EndNote attachments have been detected in the RIS file." 
 +  End If 
 +End If 
 + 
 +function GetFile(FileName) 
 +  If FileName<>"" Then 
 +    Dim FS, FileStream 
 +    Set FS = CreateObject("Scripting.FileSystemObject"
 +    on error resume Next 
 +    Set FileStream = FS.OpenTextFile(FileName) 
 +    GetFile = FileStream.ReadAll 
 +  End If 
 +End Function 
 + 
 +function WriteFile(FileName, Contents) 
 +  Dim OutStream, FS 
 +  on error resume Next 
 +  Set FS = CreateObject("Scripting.FileSystemObject"
 +  Set OutStream = FS.OpenTextFile(FileName, 2, True) 
 +  OutStream.Write Contents 
 +End Function 
 +</code>
  
-    internal-pdf:// +== Remark on sed statement ==
  
-And then replace it with+Thanks for the tip. If the previous sed statement doen't work for you, try 
 +<code> sed -e 's/internal-pdf:\/\//file:\/\/[escaped-path-to-pdfs]\//g' [input.ris] > [output.ris] 
 +</code> instead.
  
-    file://location/where/endnote/stores/your/pdfs+Explanation: The previous sed statement did not work for me, as it removes the subdirectory contained in the RIS file exported by Endnote, resulting in [base-pdf-dir]/[filename.pdf]. However, to find the PDF [base-pdf-dir]/[subdir_named_by_endnote]/[filename.pdf] is neccessary.
  
-In Windowsthis would look more like+Example: Your Endnote library called Literatur (i. e. Literatur.enl and Literatur.Data)and the exported RIS file Literatur.txt are located at H:\EndnoteTest. Run <code>sed -e 's/internal-pdf:\/\//file:\/\/H:\/EndnoteTest\/Literatur.Data\/PDF\//g' Literatur.txt > Literatur_2zotero.ris</code> The resulting file Literatur_2zotero.ris can be imported in zotero.
  
-    file://C:/location/where/endnote/stores/your/pdfs 
  
-From there, you should be able to import the RIS file into Zotero as you normally would.+{{tag>kb entry}}
kb/exporting_from_endnote_with_pdfs.txt · Last modified: 2017/11/22 12:58 by bwiernik