Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading rar file without extracting it  RSS feed

 
Shiva Kumar V
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I want to know how to read the archived files with rar extension.
I have about 10000 text files. I dont want to extract the file as the text files are very big and i am using winrar 2.9 version.
I want just to read the contents of the text file without extracting rar file.

Please help me.......... Waiting for some response....
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shiva Kumar V wrote:Hi ,
I want just to read the contents of the text file without extracting rar file.


I hope you mean you want to look at the list of files contained in the rar file. RARoScope is a library that can do this. If you really want to read the contents of the compressed text files, you have to uncompress (=extract) them to read them!

 
Shiva Kumar V
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim..... But i want to read the file without extracting.
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Shiva Kumar V " welcome to Javaranch
please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.
 
Mike Simmons
Ranch Hand
Posts: 3090
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shiva Kumar V wrote:Thanks Tim..... But i want to read the file without extracting.

Sure, no problem:

There you go - you've read every byte in the file, and you haven't extracted anything.

If you wanted something else, perhaps you could share with us how "reading" a file would be different from "extracting" the file. I can think of several possible interpretations (such as the one I just gave), but I don't want to play guessing games here. Tim has already made a reasonable attempt at guessing what you meant, and you replied by repeating exactly what you'd said the first time, with no additional detail. That's not really helpful here. People are trying to help you, but you need to try to better explain what it is that you need. Good luck.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out ZipInputStream andGZipInputStream.
 
Mike Simmons
Ranch Hand
Posts: 3090
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(But don't anyone tell him that those classes extract files from compressed formats, because that would violate the requirements.) ;)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!