T O P I C R E V I E W |
oszkoa |
Posted - 04/08/2004 : 3:05:46 PM 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 |
4 L A T E S T R E P L I E S (Newest First) |
oszkoa |
Posted - 04/12/2004 : 2:36:27 PM 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 |
Mike Buess |
Posted - 04/12/2004 : 07:44:16 AM 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 |
oszkoa |
Posted - 04/11/2004 : 4:09:36 PM 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 |
Mike Buess |
Posted - 04/08/2004 : 3:22:33 PM Hi Oszkoa,
See this topic. (Particularly the last two posts.)
Mike Buess Origin WebRing Member |
|
|