Author |
Topic |
|
Thomas M
Germany
Posts |
Posted - 05/03/2005 : 03:27:14 AM
|
Origin Version (Select Help-->About Origin): 6.0 Operating System: w98
Hi,
I want to know if it is possible to seperate Data from one cell. For example, if the cell contains Data in the way hh:mm:ss, is it possible to transfer the hh to a new cell, the mm to an other and the ss to a third, make calculations and combine the results in one cell again, so that i got:
wks1: col_1: hh:mm:ss -->
wks2: col_1: hh col_2: mm col_3: ss -->
wks3: col_1: hh':mm':ss'
Is there a way to do this? Maybe by position (1 and 2 are hh, 4 and 5 are mm, 7 and 8 are ss) ore by seperator (all before the first ":" are hh, all between the ":" are mm and all behint the second ":" are ss)?
Thanks in advance |
|
azazell0
Hungary
Posts |
Posted - 05/03/2005 : 3:46:06 PM
|
You'll need: - three worksheets (for example, Data1, Data2, Data3); - Data1_A and Data3_A should be set to Time and HH:mm:ss; - your time vales typed to Data1_A.
Then, you can use the following LabTalk script (to run, either copypaste it to the script window (Alt+3), select it, and press enter OR create a text label somewhere on Data1, and copypaste it to its label control window - of course, select Button Up):
%q=Data1; %r=Data2; %s=Data3;
%r_A=int(%q_A*86400 / 3600); %r_B=int(mod(%q_A*86400, 3600) / 60); %r_C=mod(round(%q_A*86400), 60);
(In the first part, you can set your own wks names)
You can combine the three columns to Data3_A with the following LT line:
%s_A=(%r_a*3600+%r_b*60+%r_c) / 86400;
Hope it helps. |
|
|
azazell0
Hungary
Posts |
|
Thomas M
Germany
Posts |
Posted - 05/04/2005 : 04:17:47 AM
|
Thanks, it seems to work! |
|
|
|
Topic |
|
|
|