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
 Making a script more versatile

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
MbelairB Posted - 05/12/2023 : 11:35:57 AM
OriginPro 2021
9.8.0.200
Windows 10 Pro

Hi all

So....I am working on a custom analysis template. To start off, I have a set of multiple xy data, which are being normalized and stored in a new sheet. In the original sheet (let's call it rawData) there is also a user parameter which serves as a cut off. This is an individual number for each y-value.

For my further analysis, I wanted to make a new sheet which only copies the normalized data beyond the cut off point. So if I had for instance 5k data points and my cut off is 2k, only the last 3k values should be transferred to the new sheet.

So far, my approach was a short lab-talk script, which I implemented into the first column via the "set values" menu:
wrcopy iw:= normalized! c1:=[j] c2:=[j] r1:=rawData!wcol([j])[D"cut off"] dc:=[j] ow:=cropped;


This works exactly as I wanted, but I have to implement it manually into every column on its own. I don't know why, but when I try to change the upper range c2, it will copy data for all columns using only the cut off value of the first column. I am still unexperienced with labtalk, so I don't understand how I could make wrcopy use the cut off for the specific column.
Do I have to write a loop in order to properly cycle through the indivdual values or is there a more elegant variant?

Would like to avoid loops as it is slowing down the data handling quite a lot (tons of data...)

Best regards
Marv
2   L A T E S T    R E P L I E S    (Newest First)
MbelairB Posted - 07/04/2023 : 10:52:55 AM
Thank you very much James!

Works like a charm and safed me from days of unnecessary work!

YimingChen Posted - 05/12/2023 : 2:33:23 PM
wrcopy is to copy/paste a block of data in the worksheet, while in your case you need to copy column by column as the starting row varies for each column. You can probably use the Set Multiple Column Values.. See the attached project file. You can highlight all columns in cropped worksheet, select "Set Multiple Column Values" and use the script shown in the figure.

https://my.originlab.com/ftp/forum_and_kbase/Images/setMultipleCols.opju




James

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