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
 Import, calculate new column, plot

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
ONeilll Posted - 04/27/2020 : 08:38:07 AM
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

2   L A T E S T    R E P L I E S    (Newest First)
ONeilll Posted - 04/29/2020 : 02:26:20 AM
Dear AmandaLu,
thank you very much for your fast reply. This is exactly what I was looking for. Thanks for your support!
Best
ONeilll
AmandaLu Posted - 04/27/2020 : 11:51:37 PM
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

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