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
 Origin Forum
 Combining hh mm ss into one cell

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
angeladoherty Posted - 08/23/2006 : 5:53:47 PM
Origin Version (Select Help-->About Origin): 6.0
Operating System: WinXp

All all. I have a problem. I have data from a GPS receiver that records the time into 3 separate cells. One for hours, minutes and second. It is puzzling me how I can combine those 3 things into one time code (hh:mm:ss.####). I have tried the good old combine columns things and played a bit with scripts but with no luck. Any ideas?

Thanks,
angela
1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 08/23/2006 : 10:46:12 PM
Hi Angela,

This script will work as long as hour, min and sec columns are 1, 2 and 3...

wks.col=4;
wks.insert(Time); // insert Time col at position 4
loop(i,1,4) {wks.col$(i).format=2}; // format cols 1-4 as Text
loop(i,1,wks.maxrows) {
%Z=col(1)[i]$;
%A=col(2)[i]$;
%Z=%Z:%A;
%A=col(3)[i]$;
%Z=%Z:%A;
col(4)[i]$=%Z;
};
repeat 3 {del col(1)}; // delete first 3 cols
wks.col1.format=3; // format col 1 as Time
wks.col1.subformat=11; // subformat hh:mm:ss.###

Mike Buess
Origin WebRing Member

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