Click here to Skip to main content
15,907,236 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have one zipped folder in that there is one text file .
can any one tell me How to read text from text file without extracting zipped folder.
Posted

Supposed you have your problem solved and successfully read the content of one of the zipped files. Essentially, you extracted the file from zip. It looks like you asking: "how to extract a file without extracting". I understand, it sound casuistic, but this is because your formulation of the problem has no certain well-defined meaning. As you are a software developer, you need to be able to provide more strict formulations of your statement or questions.

Most likely, you meant something different: how to extract some zipped file directly into memory, avoiding creation and any temporary files. Is that correct? I would be much surprised if my assumption was wrong.

One of the ways to achieve it is using open-source DotNetZip. This is explained here:
http://stackoverflow.com/questions/12715945/unzip-a-memorystream-contains-the-zip-file-and-get-the-files[^].

—SA
 
Share this answer
 
Comments
Maciej Los 7-Mar-14 2:47am    
+5
Sergey Alexandrovich Kryukov 7-Mar-14 8:55am    
Thank you, Maciej.
—SA
Devraj Kapdi 7-Mar-14 2:50am    
Thank you Sergey Alexandrovich ... :)
Sergey Alexandrovich Kryukov 7-Mar-14 8:55am    
You are very welcome.
Good luck, call again.
—SA
sir, you can only do so if you have knowledge that how the file is being compressed or what method is being used to compress it as when a folder is compressed every file in it is compressed separately.

You could use a library such as SharpZipLib or DotNetZip to unzip the file and fetch the contents of individual files contained inside. This operation could be performed in-memory and you don't need to store the files into a temporary folder.

SharpZipLib:http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx[^]

DotNetZip:http://dotnetzip.codeplex.com/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900