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
 how to calculate the sum of every n columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

adilmeraki

1 Posts

Posted - 12/17/2015 :  3:04:51 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I have one X axis and 12000 Y axis, but I want to have summation of every 10 columns and create new books. Okay I can do it by worksheet-reduce columns-merge columns but it takes too much time especially that kind of huge data set. it should be some script to make it faster.

my another problem is that i am finding integration for my spectra some specific peaks and needs repeat this integration many columns. Now I use batch peak analyze but it also takes long time for huge data set.


thank you

Hideo Fujii

USA
1582 Posts

Posted - 12/17/2015 :  5:55:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Adilmeraki,

Please try the following script which produces a summarized new worksheet from the current worksheet. Essentially it's just a loop of the worksheet-reduce columns-merge columns:
nskip=10;
icol=1;
for(ii=1; ii<wks.ncols; ii=ii+nskip) {
  wreducecols method:=merge ncols:=nskip merge:=sum start:=icol ow:=ColSummary;
  icol=icol+nskip;
}
Hope this works.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 12/17/2015 6:07:12 PM
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