in reply to Re: Searching a gzip file
in thread Searching a gzip file

That is a very methodical approach and I will try the approach and post my code once its done. If I understand it correctly, this involves unzipping the file and using a file pointer to remember where I last stopped scanning. Is there any other way of doing it without unzipping the file? I am not averse to using awk/sed but from my limited knowledge, I cant seem to come up with a way of achieving this. The point I am getting struck is remmebering the position of pattern 1. Thats why I thought perl will rescue me with file handlers. But anything with file handlers will impose a limitation on the size of file I am dealing with. Also, I would like to point out that each of pettern 1 and pattern 2 are different.

< name > name 1 < /name >

#unknoen no of lines

< id > unique id1 < /id >

#unknow no of lines

< name > name 2 < /name >

#unknoen no of lines

< id > unique id2 < /id >