How to export Agilent ChemStation .D data to CSV
An Agilent .D folder is not one file but a set of binary files, one per detector signal. To get the numbers into Excel, Origin, Python or R you need to decode those files. Three ways to do it, from quickest to most scriptable.
What is inside a .D folder
| File | Contains |
|---|---|
DAD1A.ch, VWD1A.ch | One UV channel at a set wavelength (the signal name holds it, e.g. Sig=254,4) |
FID1A.ch | A GC flame ionization detector signal, usually in pA |
ADC1A.ch | An analog input, typically CAD or ELSD |
DAD1.UV | Full diode-array spectra: absorbance at every wavelength, at every time point |
data.ms, MSD1.MS | Mass spectra from a single-quadrupole MS, scan or SIM |
The rest of the folder (ACQ.M, RUN.LOG, SAMPLE.XML) holds the method, the run log and sample information.
Option 1: in your browser, no install
- Open Nagura Lab and drop the whole
.Dfolder on the page (or several folders at once). - Tick the signals you want. Runs overlay on one chart, so you can compare injections directly.
- Press Download CSV. The file has a time column in minutes and one column per signal, with units in the header.
The files are decoded on your own computer. Nothing is uploaded, which matters for confidential or unpublished data.
Option 2: from ChemStation or OpenLab itself
If you have the software on a licensed PC, the signal can be exported from data analysis. Menu names differ between ChemStation revisions. For OpenLab CDS 2.4 and later, Agilent describes the steps in Export Chromatogram Signal as CSV.
Option 3: in Python, with rainbow
The open-source rainbow library reads the same files. It is what Nagura Lab's decoders are tested against.
pip install rainbow-api
import rainbow as rb
run = rb.read("sample.D")
print([f.name for f in run.datafiles]) # e.g. ['DAD1A.ch', 'DAD1.UV']
run.get_file("DAD1A.ch").export_csv("DAD1A.csv")
For R there is chromConverter, which wraps several of these parsers.
Common problems
- "The .D shows up as a folder, not a file." That is normal. Select or drop the folder itself.
- Times start slightly below zero. Some files store the first sample a fraction of a second before injection. The values are as recorded.
- Negative absorbance at low wavelengths. Below about 200 nm the lamp output is weak and many methods show strongly negative values there. It is not a decoding error.