• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with opening zip file and reading the contents in the zip files  RSS feed

 
Sanny kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

i have a zip file which contains 20 files.i want to read the 2nd line of the file which in the zip format.can anyone plz help me?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java.util.zip package helps with Zip files. Check out the ZipFile class, particularly the getEntry and getInputStream methods, which will get you access to a particular file inside the Zip file. Once you have an InputStream, it should be easy to get at its second line.
 
payal agrawal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the URLs below:

How to read files within a zip file
http://www.java-tips.org/content/view/601/2/

How to extract file/files from zip file
http://www.java-tips.org/content/view/600/2/
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!