Get Compressed byte offset from .gz file

Hi ,

I have a .gz file whose contents look like below.
data1^filename1
data2^filename2.
..
.
.

Is it possible to find out the byte offset of each record from the .gz file.

Like in an uncompressed file.
grep -nb "Filename" give the byte offset of the record in this case.

Thanks,
Chetan.C

This leaves the compressed file as is:

gzcat x.dat.gz|grep -nb "filename"

Thanks Gary.
But what i want to know is the compressed byte offset.

Example:
Record1:
Compressed byte offset:0
Record2:
Compressed byte offset=Compressed byte length(Record1).

Something like this.Is this possible.?

Thanks,
Chetan.C

Oh, sorry, no idea. I am interested to know why you want to know this though.

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.

(original was here)