5

I am trying to load a medium sized zipped archive (.zip file ~140 Mb) that can be found here (direct link) (source: Deutsche Bundesbank (website)). After downloading the file it is saved as "BKK-Download.zip". The file contains ~50.000s xml files with some rather strange names (such as "bbai3.q.de.n.v.bf90.f.kv.a1.s.2.n.e.z.xml") in three subfolders.

In a first step I try to open the "tree.xml" file in the "tree" folder, in a second step I will open the file using the XML package. I try the first step by using the unzip function:

f.path <- "path to the file"
dat <- unzip(paste0(f.path, "BKK-Download.zip"))

library(XML)
xml.content <- xmlParse(dat[1]) 
# for the case that "tree.xml" is the first xml-file

But instead, the unzip-command returns the following error:

Warning message:
In unzip(paste0(f.path, "BKK-Download.zip")) :
  error 1 in extracting from zip file

If I try this with a test zip-archive with multiple folders and complicated file names (like the one mentioned above) everything works fine.

Any ideas why this error might occur?

David
  • 9,216
  • 4
  • 45
  • 78
  • 2
    I have run into the exact same error when trying to extract from a UNIX compress (.Z) and was able to resolve by using `R.utils:::gunzip` – mlegge Sep 25 '15 at 16:04
  • is this in the utils package, latest 3.2.1? I've loaded it and can't find `gunzip`. – Shawn Mehan Sep 25 '15 at 16:25
  • its the "R.utils" package not the "utils" package! – David Sep 25 '15 at 16:31
  • I have no idea what I did, but all of a sudden it works, i.e., it does not return the error... @mkemp6, I tried the `gunzip` but got many errors... – David Sep 25 '15 at 16:34

0 Answers0