Read specific file from a zip archive without extracting


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Read specific file from a zip archive without extracting
# 1  
Old 12-02-2008
Read specific file from a zip archive without extracting

Hi All,

I would like to extract specific file from a zip archive.

I have a zip archive "sample.zip".

sample.zip contains few text files and images... text1.txt, text2.txt, pic.jpg etc...

I need to read specific file "text2.txt" from "sample.zip" WITHOUT EXTRACTING the zip file.

Please Suggest.
# 2  
Old 12-02-2008
Hi,

I think it is not possible to read a specific file from a zip file without unzipping it.
Comments are welcome!!!!
# 3  
Old 12-02-2008
Bug It is possible

Hey guys,

We can read the specified file from an archive without extracting. I used the below code.


Code:
 
unzip -p test.zip "text.txt"

# 4  
Old 12-02-2008
when u use unzip cmd its getting extracted right??
# 5  
Old 12-02-2008
Java @nohup

No. It will not get extracted when using "unzip -p" option.

It'll fetch the contents alone without extracting. I tried it.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Linux read specific content file from tar.gz files without extracting

hello i wish to write the result of these below conditions in a file: 1. in a specific folder, i have many tar.gz files. 2. each tar.gz file contains ".dat" file in sub folders. 3. i wish to get the full path of these .dat files, if i find in it a specific word ("ERROR24"). 4. all this... (6 Replies)
Discussion started by: jimmyjames9
6 Replies

2. Shell Programming and Scripting

Grep in a specific file in an archive

Hi all, I need to do a grep in a specific file inside multiple (tar.gz) archives. I know zgrep can grep in an archive, but as far as I know, I can't supply a specific filename from inside the archive to grep in. Is there any other way do to this, besides extracting it and then... (1 Reply)
Discussion started by: Subbeh
1 Replies

3. Shell Programming and Scripting

Zip a list of specific files to an archive

Hi all, i've got the following problem: We've got a shell-script, that creates some different files based on several criteria given, using a sql-script. After creating, those files are individually zipped and stored, then sent to a ftp-server. This is all working since 2010, but now they have... (3 Replies)
Discussion started by: Biggreuda
3 Replies

4. Homework & Coursework Questions

Creating and extracting archive file

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hi there, I wish to create a single .tar file of the current directory but have literally no idea on where to... (8 Replies)
Discussion started by: Banned
8 Replies

5. Shell Programming and Scripting

Extracting from archive | compressing to new archive

Hi there, I have one huge archive (it's a system image). I need sometime to create smaller archives with only one or two file from my big archive. So I'm looking for a command that extracts files from an archive and pipe them to another one. I tried the following : tar -xzOf oldarchive.tgz... (5 Replies)
Discussion started by: chebarbudo
5 Replies

6. UNIX for Dummies Questions & Answers

Zip file with specific name

Hi, How could compress a file with a specific name. For example if I put the following: gzip -f file.dat I compressed it with the same file name to compress, "file.dat.gz". How could compress it with the name I want for example test.gz. Thanks. (4 Replies)
Discussion started by: pepeli30
4 Replies

7. UNIX for Dummies Questions & Answers

unzip .zip file and list the files included in the .zip archive

Hello, I am trying to return the name of the resulting file from a .zip archive file using unix unzip command. unzip c07212007.cef7081.zip Archive: c07212007.cef7081.zip SecureZIP for z/OS by PKWARE inflating: CEP/CEM7080/PPVBILL/PASS/G0063V00 I used the following command to unzip in... (5 Replies)
Discussion started by: oracledev
5 Replies

8. UNIX for Dummies Questions & Answers

Extracting from a tar archive file

Can I extract files from an archive file (tar), where the filename includes the full directory path, to a different directory? For example the archive files may have a filename of /SrcFiles/XXX/filename.dat and I want to extract it to /SrcFiles/YYY/filename.dat. Since the archive file was... (1 Reply)
Discussion started by: nmalencia
1 Replies

9. AIX

Updating a File in a Zip Archive

Hello everyone, I have a script that pulls a text file out of a zip archive and updates the file. What I need to do is put it back in the zip archive and replace the old one, but I am having no luck. Everything I search on forums or internet points to the command zip, that command is not... (6 Replies)
Discussion started by: dbridle
6 Replies

10. UNIX for Dummies Questions & Answers

Is extracting specific files from a zip file possible?

If a zip file contains several zip files, but if the file names of the files needed are known, is there a variation of the unzip command that will allow those few (individual) files to be extracted? --- Example: Zip file name: zip.zip unzip -l zip.zip will display file01, file02, file03, etc.... (1 Reply)
Discussion started by: HLee1981
1 Replies
Login or Register to Ask a Question