Page 1 of 1
simdis time slices on chemstation
Posted: Wed Feb 03, 2010 7:48 pm
by chromatographer
Can anyone tell me how to export simdis time slices of regular time intervals from chemstation (I'm using A.10.01) to a .csv file? Or, is there a not-too-difficult way to convert the raw .ch data to .csv? Thanks!
Posted: Thu Feb 04, 2010 6:28 pm
by GasMan
Try this macro.
*****************************************************
Name csvfile
Local cols,runtime,signal,i
cols=DataCols (Chromreg)
Open "C:\temp\test.csv" For Output as #5
For i=1 To cols
runtime=Data (Chromreg,0,i)
signal=Data (Chromreg,1,i)
print#5,runtime,",",signal
Next i
Close#5
endmacro
********************************************************
It is bare bones, but you can see if it will do what you need.
Copy the information above into Notepad and save it as Makecsv.mac
Copy this file into the CORE directory of your ChemStation.
With ChemStation running, type into the Command line "macro makecsv.mac" (Quotation marks not needed)
Make sure that you have a folder named 'Temp' in your C drive or change the file name in the 'Open' statement in the program.
Make sure you have a data file loaded into ChemStation.
Type into the Command line 'csvfile'. You should get the csv file into your folder.
Gasman
It works!
Posted: Thu Feb 04, 2010 9:43 pm
by chromatographer
Your macro works like a charm! You are awesome GasMan! Thank you! Thank you! Thank you!
Re: simdis time slices on chemstation
Posted: Thu Apr 14, 2011 6:02 am
by particleman
Hi,
New to the forum and relatively new to chromatography, but hopefully someone can help me out. I am trying to do the same thing (Extract GC-MS chromatograms into a .csv or other delimited text file) but this macro won't work with my version of Chemstation (D. 02.00.275) which appears to use a different directory and file structure than that used in that which this macro was written for.
I've tried monkeying around in the macro language and can get the chromatogram data into a data object ('chromatogr' command) but can't figure out how to get the individual columns out of that structure. The 'tabulate' command will put out a file, but it is horribly formatted (ideally, I'd like a RT column, then ion1, ion2, etc.).
Anyhow, I have already banged my head against this problem enough for my liking, anyone want to swoop in and tell me what to do?!?!
Thanks in advance,
Andy