Reputation: 1054
We have multiple large .zip files (500 GB+ compressed, 5 TB+ uncompressed). Each .zip file contains one compressed file, that compressed file is password protected.
We would like to use either a UNIX (Cygwin) or DOS command to extract around 100 rows from the top and a 100 rows from the bottom of the password protected single compressed file that is contained within the .zip file.
It appears that the zcat
command affords us the ability to specify head
and tail
commands allowing us to extract portions of the compressed file without having to unzip the entire file. The issue we're running into is that the compressed file is password protected and we don't know if there is a utility we can use to specify the password on the command line and allow the file to be read by zcat
, without having to fully unzip the file.
Is it possible for us to somehow combine the zcat
command with another command which would unlock the password protection on the compressed file and redirect the top 100 and bottom 100 rows of the compressed file to an output.txt file?
Upvotes: 0
Views: 120
Reputation: 265161
zcat
is used to extract gzipped files; it does not work with .zip
archives. Even if it were, to get the last lines of a compressed file, you'd still need to decompress the full file – unless the compression algorithm specfically allows only decompressing part of a compressed file (which would yield worse compression rates).
Upvotes: 0