Reading compressed files
Shadab Sayani
shadabsayani at yahoo.com
Tue Feb 20 19:40:13 EST 2007
Hi,
I have compressed files compressed using different techniques (especially unix compress). So I want to have a module that reads any of these (.Z,.bz,.tgz files) files and manipulates the data.
The data has a syntax.It contains
HEADER (some information)
BODY (some information)
FOOTER (some information)
If it were a normal text file I can get the values corresponding to HEADER BODY and FOOTER by open function.
But here the files are in different format .Z , .bz ,.tgz,.gz .But I know these are the only formats.Also I cannot rely upon the extensions of the file (a .Z file can have no extension at all).Is there a way to identify which file am I reading and then read it?If so how to read it?
Thanks and Regards,
Shadab.
Send instant messages to your online friends http://uk.messenger.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070221/57736f93/attachment.html>
More information about the Python-list
mailing list