The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
read file from tar.gz archive krylin High Level Programming 9 05-20-2009 04:51 PM
Extracting specific text from a file rahulkav Shell Programming and Scripting 8 10-22-2008 10:34 AM
Extracting from a tar archive file nmalencia UNIX for Dummies Questions & Answers 1 03-22-2008 09:38 AM
Read from file then purge or archive. kayarsenal Shell Programming and Scripting 15 08-10-2006 08:24 AM
Is extracting specific files from a zip file possible? HLee1981 UNIX for Dummies Questions & Answers 1 10-14-2005 11:06 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-02-2008
sridharg sridharg is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 4
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 (permalink)  
Old 12-02-2008
anbarasan.s anbarasan.s is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 1
Hi,

I think it is not possible to read a specific file from a zip file without unzipping it.
Comments are welcome!!!!
  #3 (permalink)  
Old 12-02-2008
sridharg sridharg is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 4
Smile 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 (permalink)  
Old 12-02-2008
nohup nohup is offline
Registered User
  
 

Join Date: Nov 2008
Location: India
Posts: 12
when u use unzip cmd its getting extracted right??
  #5 (permalink)  
Old 12-02-2008
sridharg sridharg is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 4
Post @nohup

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

It'll fetch the contents alone without extracting. I tried it.
Closed Thread

Bookmarks

Tags
extract, read, shell, unzip, zip

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0