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 do i merge 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

verv

9 Posts

Posted - 02/07/2017 :  08:48:39 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: OriginPro 8.5.0 SR1
Operating System: Windows 8.1

I have muliple .opj files with the following structure: only one workbook with three sheets, which are: Graph, Data (table), and Note.

I want the result file to consist of the table with columns from multiple "Data" sheets from different .opj files, preferably with the column comments equiled to the names of .opj files.

How can I do it in an automatic way without any open/drug/drop/copy/past/etc? Or, if there is no way, more simple: how do I merge many workbooks in one to play with their sheets in one place?

Hideo Fujii

USA
1582 Posts

Posted - 02/07/2017 :  12:05:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi verv,

Origin is capable to import the worksheet data in an Origin project file (.OPJ) by "File: Import: Origin Project"
menu. Here, you can specify the Import Mode to "Start New Column" so that you can accumulate the import data
into a single worksheet.
Unfortunately, this feature is available since Origin 9.x version. Still you can append other OPJ file's contents
("File: Append" menu), but you need the task of copy-and-pasting.

Hope this helps.

--Hideo Fujii
OriginLab
Go to Top of Page

verv

9 Posts

Posted - 02/09/2017 :  08:37:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Okay, thanks
Is there a way (in the newer version) to automate the import from the same-structured .OPJs (like multiple ASCII import) so there will not be the need to repeat the process of importing many times?
Go to Top of Page

Chris D

428 Posts

Posted - 02/09/2017 :  10:20:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can automate the process of immporting multiple same-structured OPJs as follows:

1. From the File menu, select Import->Origin Project.
2. Select one of your OPJs.
3. In the impOPJ dialog that pops up, specify your import settings but don't click OK.
4. You will see a little arrow button in the top right of the dialog.
5. Click the button and save your settings as a theme with a unique name (e.g. MyTheme).
6. Click OK in dialog to see that it imports as you like.

To automate the process:
1. From the Window menu, select Script Window.
2. Paste the following code into the Script Window.
*** Make sure to change the value of -t "MyTheme" to the name of the theme you saved.
3. Select all of the script and hit the Enter key on your keyboard.
4. Select one or more same-structured OPJs to import.
5. The script will then import them one after the other using the settings from your theme.

string sFiles$;
{dlgfile g:="*.opj" multi:=1 fname:=sFiles$;}
if (sFiles.GetLength() > 0)
{
	for (int ii = 1; ii < sFiles.GetNumTokens(CRLF); ii)
	{
		string sFile$ = sFiles.GetToken(ii);
		sFile$=; 
		//impOPJ fname:=sFile$ -t "MyTheme";
	}
}


I hope this helps.

Thanks,
Chris Drozdowski
Originlab Technical Support
Go to Top of Page

verv

9 Posts

Posted - 02/10/2017 :  12:53:18 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
string sFiles$;
{dlgfile g:="*.opj" multi:=1 fname:=sFiles$;}
if (sFiles.GetLength() > 0)
{
for (int ii = 1; ii < sFiles.GetNumTokens(CRLF); ii)
{
string sFile$ = sFiles.GetToken(ii);
sFile$=;
//impOPJ fname:=sFile$ -t "MyTheme";
}
}


I hope this helps.


Thanks, this helps a lot

However there is a problem
Any impOPJ script, as well as impOPJ -t, works only with the first worksheet even if there is the pointer to the another one. Even the generated script like this one:
impOPJ fname:=С:\somewaytofile\1.opj info.wkspage:=Book1 info.wks:=Sheet2 info.cols:={1} options.FirstMode:=1;
returnes the column 2 from Sheet1, not from Sheet2

Worth mentioning that the page from which this script was generated works as it should, importing the column from second worksheet.
I cheked this on two different machines with Windows 8.1 with two different Origins - 2016 SR0 and 2015 SR1 - and the problem stands in both

Edited by - verv on 02/10/2017 1:43:20 PM
Go to Top of Page

Chris D

428 Posts

Posted - 02/10/2017 :  4:45:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Can you download the demo of Origin 2017 and see if it is fixed? There is an issue in our bug-tracking database that is related to info.wks not working properly and being fixed in Origin 2017.

Thanks,
Chris Drozdowski
Originlab Technical Support

Edited by - Chris D on 02/10/2017 4:46:01 PM
Go to Top of Page

verv

9 Posts

Posted - 02/11/2017 :  3:12:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
In Origin 2017 the bag is fixed. Thanks
Go to Top of Page

Aaron03

Australia
2 Posts

Posted - 02/17/2017 :  12:54:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That's the thing that I was missing.
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