# How to import a “.txt” data from a large zip (2-4G) file?

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?

• Have you tried extracting the zip file first? Or if you need compression, using gzip instead of zip? – Szabolcs Nov 25 '16 at 13:59
• 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"]` – Bob Hanlon Nov 25 '16 at 14:59
• 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 – Miaoxiao Wang Nov 25 '16 at 15:04
• I think the code is right, because when I import data from some small size zip files (500M), the notebook did work!@Bob Hanlon – Miaoxiao Wang Nov 25 '16 at 15:06
• What kind of data is in files? Can it be divided into words, lines, any other structural parts? – Leonid Shifrin Nov 25 '16 at 16:20