The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 How import multiple headerlines from asciifile?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

a_user

USA
0 Posts

Posted - 08/14/1998 :  12:50:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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)?

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=

Thanks in advance
Henrik

a_user

USA
0 Posts

Posted - 08/14/1998 :  12:52:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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)

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000