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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 To read numeric data in label after ascii import

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Ray111 Posted - 06/06/2005 : 05:13:13 AM
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
4   L A T E S T    R E P L I E S    (Newest First)
Ray111 Posted - 06/07/2005 : 5:53:05 PM
Dear Mike
thanks a lot works perfectly
Mike Buess Posted - 06/06/2005 : 7:29:20 PM
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
Ray111 Posted - 06/06/2005 : 5:13:28 PM
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;

Mike Buess Posted - 06/06/2005 : 07:02:25 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000