Reading a txt file in a Zip
A problem came up...to read a text file without extracting the file from the zip file.
So it was like this how i went by it:
1] Zip file was present in my home dir by the name 'archive.zip',so listing the file in home directory was done by.
Definition of '-p' option per unix manual:
-p extract files to pipe (stdout).Nothing but the file data is sent to stdout, and the files are
always extracted in binary format, just as they are stored (no conversions).
Cheers.
So it was like this how i went by it:
1] Zip file was present in my home dir by the name 'archive.zip',so listing the file in home directory was done by.
[sawrubt@sawrub ~]#2] List the files present in that archive.
[sawrub@sawrub ~]# ll archive.zip
-- output deprecated --
[sawrub@sawrub ~]#
[sawrub@sawrub ~]# unzip -l archive.zip|tail3] And now my task was I had to read version.txt, so went by firing in the command
-- output deprecated --
9999770 09-02-09 12:09 00010b32.jdb
9999963 09-02-09 12:09 00010b33.jdb
6371421 09-11-09 11:36 00010b34.jdb
71 09-11-09 11:49 version.txt
-------- -------
628281884 504 files
[sawrub@sawrub ~]#
[sawrub@sawrub ~]# unzip -p archive.zip version.txtand all was done.
-- output deprecated --
[sawrub@sawrub ~]#
Definition of '-p' option per unix manual:
-p extract files to pipe (stdout).Nothing but the file data is sent to stdout, and the files are
always extracted in binary format, just as they are stored (no conversions).
Cheers.
Comments
Post a Comment