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
 Combining hh mm ss into one cell
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

angeladoherty

USA
Posts

Posted - 08/23/2006 :  5:53:47 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Mike Buess

USA
3037 Posts

Posted - 08/23/2006 :  10:46:12 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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