I have many large zip files (2-4G for each file) which contain many ".txt" data. I want to analyze these data in Mathematica 10.4 but I failed to import the ".txt" file. I get this super helpful error message: Import::fmterr: Cannot import data as zip format. >>

I guess it is becauce the zip files are too large, for when I import the small zip files (500M), the notebook did work!

I have tried the recommended way to increase the Java heap size: << JLink`; InstallJava[]; ReinstallJava[JVMArguments -> "-Xmx5g"] but it still did not work!

I have a system with 128G RAM. How can I fix this?

  • $\begingroup$ Have you tried extracting the zip file first? Or if you need compression, using gzip instead of zip? $\endgroup$ – Szabolcs Nov 25 '16 at 13:59
  • $\begingroup$ You did not show the code that you used that exhibits the problem, Based on the documentation, the form of the code should be Import["file.zip", "*"] or Import["test.zip", "dir/*.txt"] $\endgroup$ – Bob Hanlon Nov 25 '16 at 14:59
  • $\begingroup$ I have about 2000 zip files. if I extract them all, they may occupy about 20T space...too large to deal with and it would also take long time to extract them. your second suggestion may be helpful, but how can I transform zip to gzip by MMa or other program?@Szabolcs $\endgroup$ – Miaoxiao Wang Nov 25 '16 at 15:04
  • $\begingroup$ I think the code is right, because when I import data from some small size zip files (500M), the notebook did work!@Bob Hanlon $\endgroup$ – Miaoxiao Wang Nov 25 '16 at 15:06
  • $\begingroup$ What kind of data is in files? Can it be divided into words, lines, any other structural parts? $\endgroup$ – Leonid Shifrin Nov 25 '16 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.