If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Need Help to read text file inside Zip file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-21-05, 10:04
ram2s2001 ram2s2001 is offline
Registered User
 
Join Date: Oct 2005
Posts: 17
Need Help to read text file inside Zip file

Hi,
I need help to read Test.txt inside .zip FILE.Iam new to shell script.

Thanks Lot.
Reply With Quote
  #2 (permalink)  
Old 11-21-05, 13:13
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,454
Code:
man gzip
.....
Reply With Quote
  #3 (permalink)  
Old 11-22-05, 00:28
ram2s2001 ram2s2001 is offline
Registered User
 
Join Date: Oct 2005
Posts: 17
Quote:
Originally Posted by n_i
Code:
man gzip
.....

It was PKZIP format.

My zip file name: abc.zip
My txt file name containes in abc.zip is : test.txt
path containing in abc.zip file is: ad/bv/90876

how to unzip and store file in variable in shell script.

Thanks Lot.
Reply With Quote
  #4 (permalink)  
Old 11-25-05, 02:50
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
Read text file inside zip file

This should get you started
Code:
unzip -c abc.zip test.txt | while read line
do
  echo ">>>> $line"
done
>>>> Archive:  abc.zip
>>>> inflating: test.txt
>>>> line one in file test.txt
>>>> line two in file test.txt
>>>>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On