How to export OpenLab CDS 2 data to CSV
OpenLab CDS 2 saves each injection as one .dx file. To get the chromatograms or the DAD spectra into Excel, Origin, Python or R, you need the numbers out of that file as CSV. Three ways to do it, with or without OpenLab.
What a .dx file holds
| Signal | Example name | As CSV |
|---|---|---|
| UV at one wavelength | DAD1A.CH (Sig=210.0,4.0) | Time in minutes and absorbance in mAU |
| Full DAD spectra | DAD1I.UV | One row per time point, one column per wavelength |
| FID or RID | Named after the detector | Time in minutes and the detector signal |
A .dx is a zip archive of binary files, so opening it in Excel or a text editor shows nothing useful. See what is inside a .dx file for the details.
Option 1: in your browser, no install
- Open Nagura Lab and drop one or more
.dxfiles on the page. A.zipholding several of them works too, and so does a.dxthat an email filter renamed to.zip. - Tick the signals you want. Signals keep their OpenLab names, such as
DAD1Awith its wavelength. Injections overlay on one chart. - Press Download CSV. You get a time column in minutes and one column per plotted signal, with the unit in each header. Signals recorded at different time points each get their own time column.
The full DAD spectra: the spectrum map of the first .UV signal opens below the chart (for another one, press Explore spectra map under it). Press Download spectra matrix. Each row is a time point and each column a wavelength (190, 192, 194 nm and so on), in mAU.
A wavelength that was not recorded as a signal: click the spectrum map at that wavelength, or type it under the spectrum, press Add chromatogram, then Download CSV. More in chromatogram at any wavelength.
The files are decoded on your own computer and never uploaded.
Option 2: from OpenLab itself
On a PC with OpenLab CDS 2.4 or later, a signal can be exported as CSV from within the software. Agilent describes the steps in Export Chromatogram Signal as CSV. This needs a licensed installation and works one signal at a time.
Option 3: in Python, with rainbow
The open-source rainbow library reads .dx files. It is what Nagura Lab's decoders are tested against.
pip install rainbow-api
import rainbow as rb
run = rb.read("injection.dx")
print([f.name for f in run.datafiles]) # e.g. ['DAD1I.UV', 'DAD1A.CH']
for f in run.datafiles:
f.export_csv(f.name + ".csv")
Common problems
- "Excel shows garbage when I open the .dx." The file is a zip archive of binary data, not text. It needs a decoder first.
- "I unzipped it, but the spectra are far too large." The
.UVfiles inside a.dxneed an extra scale factor that ChemStation.UVfiles do not, so tools written for ChemStation read them about 131,000 times too large. Nagura Lab and rainbow apply it. - "Pressure and temperature are missing." Instrument traces are not shown or exported yet. Detector signals are.
- "I have hundreds of injections." Dropping many files at once works. Exporting all runs as one zip of CSV files is part of the Pro batch tools, now in early access.