Skip to content

Instantly share code, notes, and snippets.

@caschwartz
Created April 8, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caschwartz/44e5675f4194b4bfd767 to your computer and use it in GitHub Desktop.
Save caschwartz/44e5675f4194b4bfd767 to your computer and use it in GitHub Desktop.
Query to remove .DS_Store (and othe similar) files
xquery version "1.0-ml";
(: 12/20/14 Query to get a list of URIs from the dcweb database and delete .DS_Store files :)
declare namespace ia = "http://digital.library.ptsem.edu/ia";
declare namespace m = "http://www.loc.gov/MARC21/slim";
for $uri in cts:uris()
where contains($uri, "._.DS_Store") or contains($uri, ".DS_Store") or matches($uri, "\._")
return xdmp:document-delete($uri)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment