Hi Liang, this is something I've been working on recently. The peak intensities are compressed, so you need to decompress them to generate a table of peaks and intensities.
You will almost certainly want to do this with a script instead of in Excel.
For mzXML files, I first extract all scan events, then parse the peaks element as follows (in python, using the base64, struct, and lxml modules):
----
line = elem.xpath('mzXML:peaks', namespaces=NS)[0].text
decoded = base64.standard_b64decode(line)
tmp_size = len(decoded) / 8
unpack_format = "!%dd" % tmp_size # This is important. The data is double-double encoded
idx = 0
mz_list = []
intensity_list = []
for val in struct.unpack_from(unpack_format, decoded):
if(idx%2 == 0):
mz_list.append(float(val))
else:
itensity_list.append(float(val))
idx += 1
----
This returns two lists containing the m/z values and intensities, respectively for each scan.
For mzML, I've found it easier to use the pymzml module for python. Here is some code to get you started with that:
----
msrun = pymzml.run.Reader(filepath)
for s in msrun:
if s['id'] in scans:
for mz, i in s.peaks:
print(mz, i)
----
Hope this gets you going.
Best,
Jason