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 for Programming
 LabTalk Forum
 copy Cols from all the workbooks
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Salmabejaoui

USA
1 Posts

Posted - 11/22/2019 :  2:49:45 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi Labtalk user
Is it possible to copy 2 columns from all the workbooks in an origin project and paste them successively in a new workbook.
I want to do that without specifying the name of each workbook.
Thanks in advance for your help



Salma

Edited by - Salmabejaoui on 11/22/2019 2:51:39 PM

Chris D

428 Posts

Posted - 11/22/2019 :  3:35:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This code copies columns 1 & 2 from first sheet of every workbook into a single new workbook. I hope it helps.


newbook;
string sbook$ = %H;
wks.ncols = 0;
doc -e W {
	if (%H == sbook$) continue;
	dataset ds1 = col(1);
	dataset ds2 = col(2);
	win -a %(sbook$);
	wks.ncols += 2;
	copy ds1 wcol(wks.ncols-1);
	copy ds1 wcol(wks.ncols);
}



Thanks,
Chris Drozdowski
Originlab Technical Support
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