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
 transpose
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

shyamigcar2

India
25 Posts

Posted - 06/07/2017 :  10:54:42 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I wanted to transpose certain data in column 1 from 4 row to 15 row
starting from 4 row 2 column.

ie., I wanted to transpose certain ranage of row string data.

yuki_wu

896 Posts

Posted - 06/07/2017 :  10:10:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Origin has an X-Function for transposing worksheet data: wtranspose. Please take a look at this knowledge base item and see if this applies to you:
http://www.originlab.com/doc/X-Function/ref/wtranspose

Regards,
Yuki
OriginLab
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 06/08/2017 :  4:34:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Using Yuki's wtranspose x-function, you can make a code like following:
col1=2; row1=3;  //block's top left corner: column# row#
col2=4; row2=5;  //block's bottom right corner: column# row#
worksheet -s col1 row1 col2 row2;  //select specifiled block
menu -e 57634; //copy
newbook;       //make output sheet
worksheet -s 1 1 1 1;  //select 1st col, 1st row
menu -e 57637; //paste
wtranspose;    //transpose
Hope this helps.

Hideo Fujii
OriginLab
Go to Top of Page

shyamigcar2

India
25 Posts

Posted - 06/13/2017 :  10:47:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hai Fuji

I do not understand menu -e in the command lines.

Thank you

S Shyam Kumar
Go to Top of Page

snowli

USA
1384 Posts

Posted - 06/13/2017 :  12:57:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Those menu -e execute command same as you choose Origin's menus.
Each menu has its menu ID. U can see this page for how to find menu -d and how to run them by menu -e.
http://www.originlab.com/doc/LabTalk/ref/Menu-cmd#-e.3B_Execute_the_menu_command_with_the_specified_ID

Actually there is a menu ID correspoinding for Edit: Paste Transpose. So you can run
menu -e 36455; to directly paste transpose. No need to run wtranspose.



Another way is define range variable for the range in column you want to copy. And then define another range for the the row where you want to paste to.

This only works if you are copying in a single column and paste to a single row.

E.g.
range -v r1 = A[4]:A[15]; //define a range varaible r1 for row 4 to 15 of column A
newsheet; //start a new sheet
wks.ncols=r1.GetSize(); //set number of columns to be size of rows in r1
range -v r2=A[1]:L[1]; //define r2 to be 1st row
r2=r1; //assign values in r1 to r2


More info. about range -v
http://www.originlab.com/doc/LabTalk/guide/Range-Notation#Option_Switch_-vOption_Switches

Thanks, Snow
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