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
 Import, calculate new column, plot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ONeilll

33 Posts

Posted - 04/27/2020 :  08:38:07 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: OriginPro 2020 (64-bit) SR1
Operating System: Windows 10

Hey guys,
I have a file with four columns:
A B C D

The first one is a time stamp.I would like to set it to zero by col(1)-cell(1,1)

The result should be written in the column next to the first one:
A "new column" B C D
Finally, I would like to have a plot of "new column" vs C.

I tried the following which did not fully work:

%A = page.info.system.import.filename$; //Get the filename
%B = %[%A, '.'];
wks.col = 1; //set column 2 as current
page.xlcolname = 0;
wks.insert = (Zeit); // Add a column in worksheet
col(1) = col(1)-cell(1,1); // Calculate the log value of column B
plotxy iy:=((1,2)) plot:=200 ogl:=[<new template:= XRR_Templat name:= %A>]; // Plot data, rename the graph window

This script replaces the first coloumn entirely, I would like to keep it though


I hope my question is clear. Thank you very much for your effort.
Best
ONeilll


Edited by - ONeilll on 04/27/2020 09:43:52 AM

AmandaLu

439 Posts

Posted - 04/27/2020 :  11:51:37 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I modify your scripts according to your description.

%A = page.info.system.import.filename$; //Get the filename
%B = %[%A, '.'];
wks.col = 2; //set column 2 as current
page.xlcolname = 0; //Turn off "Spreadsheet Cell Notation" (SCN)
wks.insert(Zeit); // Add a column in worksheet
col(2) = col(1)-cell(1,1); // Calculate the log value of column B
plotxy iy:=((2,3)) plot:=200 ogl:=[<new template:= XRR_Templat name:= %B>]; // Plot data, rename the graph window

wks.insert(name list) is a method, not a property. Please see details here:

https://www.originlab.com/doc/LabTalk/ref/Wks-obj#Methods

And you miss up the column index so the first column was placed.

Let me know if this is not what you want.

Thanks,
Amanda
OriginLab Technical Service
Go to Top of Page

ONeilll

33 Posts

Posted - 04/29/2020 :  02:26:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear AmandaLu,
thank you very much for your fast reply. This is exactly what I was looking for. Thanks for your support!
Best
ONeilll
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