(Assuming the JP2 files are the only ones in the report to have delivery URNs.)
cat 1584126841-SLPC2033658088718609638479.txt | grep "JP2" | awk '{print "http://nrs.harvard.edu/" $11}' > list_of_image_URNs.txt
- The following generates a list of links to the JP2 files referenced in the report.
cat 1584478201-AMFoodAndDrink0066389503652647254379.txt | grep "JP2" | awk '{print "http://nrs.harvard.edu/" $2}' > list_of_image_URNs.txt
- The following generates a list of links for all XML files, which we presume to be METS files that provide access to complete objects.
cat 1584478201-AMFoodAndDrink0066389503652647254379.txt | grep "xml" | awk '{print "http://nrs.harvard.edu/" $2}' > list_of_object_URNs.txt
-
catis a command that will read a file -
1584478201-AMFoodAndDrink0066389503652647254379.txtis an example DRS report. -
|is called a PIPE.catwill feed the DRS report through the PIPE, togrep, which filters and only lets XML files pass through the next|. -
awk '{print "http://nrs.harvard.edu/" $2}'tells AWK to concatenate"http://nrs.harvard.edu/with the value of the second column of the text file. (DRS confirmation reports are organized into columns.) -
> list_of_URNs.txtwill direct the output of AWK to a text file, e.g.,list_of_object_URNs.txt.
You can now install a Linux terminal on your Windows 10 machine.
On a Mac you can install AWK via the homebrew package installer