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
 Date & time import from Excel
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

oszkoa

Hungary
47 Posts

Posted - 04/08/2004 :  3:05:46 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I have an Excel spreadsheet generated from time to time by an automatic instrument. It consists of seven columns: the first four are Month, Day of the month, Hour and Minute, the other three are pressure and temperature data. I'd like to plot these data against the date of the measurement. How can I turn that first four columns of the Excel spreadsheet into a single column of Origin with date&time format.

Thanks: Oszkoa

Mike Buess

USA
3037 Posts

Posted - 04/08/2004 :  3:22:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Oszkoa,

See this topic. (Particularly the last two posts.)

Mike Buess
Origin WebRing Member
Go to Top of Page

oszkoa

Hungary
47 Posts

Posted - 04/11/2004 :  4:09:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

thank you for your help. I used the script in the given reference and completed it as follows:

work -i 0;
wks.col1.type=4;
wks.col1.format=4;
wks.col1.subformat=10;
wks.col1.width=14;
wks.col1.name$=Dátum;
wks.col1.label$=Dátum;
wks.col2.type=1;
wks.col6.label$="Nyomás [bar]";
wks.col7.label$="Külsõ hõmérséklet [C]";
wks.col8.label$="Belsõ hõmérséklet [C]";
get col(2) -e end;
loop(ii,10,end){
month=col(2)[ii];
day=col(3)[ii];
hour=col(4)[ii];
minute=col(5)[ii];
truedate=date(2004/$(month)/$(day) $(hour):$(minute));
col(1)[ii]=truedate;
}

I suspect it is a bit clumsy and professionals could do it in a more elegant way, but it works and it was the goal. There are still some minor problems, that resist my efforts: I could not make the labels of columns 1, 6, 7 and 8 visible on the worksheet. This kind of explicit setting of the label would not be necessary if I could refer to a cell. For example "wks.col6.label$="Nyomás [bar]" could be substituted for "wks.col6.label$= the content of col(6)[9]".
And finally, instead of selecting manually columns 1, 6, 7 and 8 and clicking on the Plot/Panel/Stack menu command I would like to have it done by the program but I did not succeed. I tried to create a graph window with "win -t p stack" but it created only a single layer. I would highly appreciate your help in this point.

Oszkoa
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 04/12/2004 :  07:44:16 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Oszkoa,
quote:
...wks.col6.label$= the content of col(6)[9]
wks.col6.label$=cell(9,6)$;
wks.labels(); // show column labels

Plot in stacked layers...
wks.colsel(1,1); // select col 1
wks.colsel(6,1); // select col 6
wks.colsel(7,1); // select col 7
wks.colsel(8,1); // select col 8
run.section(PlotProf,Stack); // Plot->Panel->Stack

Note: You can find out what a menu command does by pressing Ctrl+Shift as you select the command. If it runs a LabTalk script then that script is opened in CodeBuilder. If not, then the menu ID is printed in the script window and you can execute with menu -e menuID.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 04/12/2004 07:48:04 AM
Go to Top of Page

oszkoa

Hungary
47 Posts

Posted - 04/12/2004 :  2:36:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

Thanks again. It works fine now and especially the code of selecting columns and plotting them was a huge benefit. In my previous letter I also wanted to ask how could I find out what is executed when one clicks on a menu command ('cause I remembered there was a key combination for that), but you have already answered the question.

Oszkoa
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