The zcat command or gzip -dc will uncompress and print the output of a gzipped file to stdout. So you can run, for example, zcat file.gz | grep '^ID:'. However, most systems have a command called zgrep that already does that for you.
update
Under the assumption that you have a bunch of these files, and want to print the ID line from files that contain a particular warning, you can do this:
zgrep -l 'warning : no profile data' *.gz | xargs zgrep '^ID:'
The first command, zgrep -l, prints a list of files that contain the warning. The second command, xargs, takes a list of arguments on standard input and runs a command on all the inputs. The command it runs is also zgrep, so as to print the ID line you want.
Second update
To extract just the numeric ID, take the command I previously suggested and append
| sed -e 's/^ID:\([0-9]*\) .*/\1/'
That will just print the ID number.