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
 Merge books depending on column header
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Clairekun

Germany
175 Posts

Posted - 07/16/2020 :  8:14:56 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2018b
Operating System: Windows 10

Hello,

I have several workbooks where some of the columns share a header name, while others don't, and the shared headers aren't necessarily in the same column number:





In the example above, shared headers would be Al2O3, SiO2, SO3 and CaO, while columns Fe2O3 and K2O are new. However, shared columns aren't always in the same place; i.e. SO3 is in Column 4 in the first picture, and in Column 5 in the second one.

Would it be possible to merge both workbooks/worksheets so that the values from shared headers always get appended to the correct column, while new columns are created for new headers?

I don't need any particular column order, and I wouldn't mind having to specify header names manually, in case it was necessary.

Thank you.

AmandaLu

439 Posts

Posted - 07/16/2020 :  11:27:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Please try Worksheet: Joint Worksheets by Label. Here is the detailed document:

https://www.originlab.com/doc/X-Function/ref/wjoinbylabel

Thanks,
Amanda
OriginLab Technical Service
Go to Top of Page

Clairekun

Germany
175 Posts

Posted - 07/22/2020 :  08:47:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, took me a while to fully understand the command, but finally managed to do it.

I used:

wjoinbylabel irng:=(1:end)! label:=L unmatch:=0 multiple:=0 ow:=[<new>]<new>; 
win -r %(page.name$) Merged;
layer.name$ = Results;


Regards,

Claire.
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