Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005
    Posts
    17

    Unanswered: 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.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Code:
    man gzip
    .....

  3. #3
    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.

  4. #4
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1

    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
    >>>>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •