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 for Programming
 LabTalk Forum
 To read numeric data in label after ascii import
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Ray111

Israel
Posts

Posted - 06/06/2005 :  05:13:13 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi
I will bel gald if somebody can help me in the following
After I import ( origin 6.1 in Labtalk) some ascii data from a XPS machines (shown below, with ascii option origin 6.1) two usefull numeric data(energy 1486.6 and 50) goes as label in one of the column and I like to read that two numeric data ( 1486.6 and 50 )and use them in one formula that I will use later.
Is their any way to read numeric data burried inside the label with text in Labtalk ( Origin 6.1) or any way to import the whole data as if and then read the data of that cell ( I didnt able to import the data inside a cell always it goes to label )
The data I tried to import is a output data from Cratos XPS machines

The data comes as follows
----------------------------------
(* format_identifier *) VAMAS
(* institution identifier *) Abcdf
(* instrument model identifier *) axis hs
(* operator identifier *) kratos
(* technique *) XPS
(* analysis source label *) Mono
(* Chs energy *) 1486.600001
(* analysis source strength *) 50.000000
(* analysis source beam width x *) 1E37
(* analysis source beam width y *) 1E37
(* analysis source polar angle of incidence *) 1E37
*minimum ordinate value *) 99783.000000
(* maximum ordinate value *) 105469.000000
(* ordinate value 1 *) 105469.000000
(* ordinate value 2 *) 103885.000000
(* ordinate value 3 *) 104052.000000
(* ordinate value 4 *) 103052.000000

Mike Buess

USA
3037 Posts

Posted - 06/06/2005 :  07:02:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
So everything you quoted above appears in one column label? Assuming it's column 3 you can get the Chs energy parameter, for example, like this...
%Z=wks.col3.label$; // get entire label as %Z
%A=%[%Z, >"(* Chs energy *)" ];
xx=%[%A, @1];
xx=;
XX=1486.6
You can find out more about substring notation in the LabTalk guide...

Help > LabTalk > Overview > Data Types > String Variable > Substring Notation

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 06/06/2005 07:05:13 AM

Edited by - Mike Buess on 06/06/2005 07:10:47 AM
Go to Top of Page

Ray111

Israel
Posts

Posted - 06/06/2005 :  5:13:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Mike for great sugession.
I would appreciate of u can help me little more.

I tried and the prob is when I import the file
with ascii option ( option- space, skip main header- 2) then the 5 th column label comes as

O
state
particle
Kinetic
eV
1486.600
50

so after import if I run following

run.section(,BE,%H);

[BE]

%Z=wks.col5.label$;
%A=%[%Z, >"eV" ];
xx=%[%A, @1];
wks.addcol(energy) ;
wks.col8.type=4 ;

// Here now I want to fill new energy column (8th clolumn) with a series of value starting from xx (here 1486.6)with increment (here 50 that also vary with file type imported) for each cell
How should I do ?

I dont know how to do this ( in set column value this should be done by --> col(energy)=xx+ (i-1)*50
or I know script like below that work but operate on values on another column but for fresh column with certain formula like above how should I do?
%(%H,wks.ncols)=%(%H,2)+2;

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 06/06/2005 :  7:29:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
in set column value this should be done by --> col(energy)=xx+ (i-1)*50


If col(8) already exists then this is a good way to fill it with the values you want...

nrows=wks.nrows; // how many rows?
col(8)=data(1,nrows); // fill column with integers from 1 to nrows
col(8)-=1; // subtract 1
col(8)*=50; // multiply by 50
col(8)+=xx; // add xx

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 06/06/2005 7:29:55 PM
Go to Top of Page

Ray111

Israel
Posts

Posted - 06/07/2005 :  5:53:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Mike
thanks a lot works perfectly
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