Re: How to import multiple headerlines from asciifile?I wrote:
> I'm currently programming a script to import data from
> an ascii-file. This file contains multiple headerlines
> (about 25) with important information that would be
> very interesting to extract from the file (the data format
> of the ascii-file is "JEOL-DX" from af Tandem Mass Spectrometer)
> and plottet on the resulting graph.
>
> My question is: Can this be done in a script? Alternativly
> can this be done at all (e.g. via a template)?
And the answer is, yes! All information in the imported ascii-file
which is not in two columns, is stored in the system-variable %Z.
This can without problems be manipulated (e.g. extract lines).
An example: label -p 60 (-8) -s Measured %[%[%Z,@6],>'='];
Gives all text to the right of "=" in line number 6 of the header.
And maybe more interessting. I can place the entire header in the script-
window. This way you don't HAVE to read all header infomation, but you
don't loose it.
Like this: type -a %Z;
> Example ascii-file:
>
> ##TITLE=Mass Profile Spectrum of 9901-45 + 46
> ##JEOL-DX 2.00
>
> ##SAMPLE NAME= 3-methyl-2-butanol-1,1,1-d3
> ##NPOINTS= 1245
> ##DATA=
> 44.5016 159705
> 44.5030 158809
> ##END=
I hope others can use this information. BTW, Origin Tech Support
couldn't tell me this when I asked...
Henrik
(script avaliable upon request - henrik@kiku.dk)