in reply to Searching a gzip file
I would unzip the file to a temporary location, then process it as a normal file.
This is the sort of thing that you could easily do with the awk tool, or of course with Perl. The general approach that I would use is that of a state-machine.
In this approach, consider that there are exactly four kinds of lines you can be looking at, at any time:
So, the general idea is to imagine a 3x4 rectangular table and to work out, for each square, what the program needs to do.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Searching a gzip file
by baski (Novice) on Aug 26, 2010 at 15:08 UTC | |
|
Best way to search through blocks of data
by baski (Novice) on Sep 11, 2010 at 02:57 UTC |