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
 copy column name&label
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bjorn

Gothenburg, Sweden
18 Posts

Posted - 02/01/1999 :  4:24:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,
is there a way to also copy the column name and label when copying data to a new column?
Thank You!

scottp

USA
60 Posts

Posted - 02/03/1999 :  2:27:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply

In your post you state you want to copy both the column name and label along with the data. Do you want to copy the data to another column in the same worksheet or to a column in a different worksheet?

Origin names each column of data with a unique dataset name. The dataset name is the worksheet window name and an underscore "_", followed by the column name. An example of this is Data1_B, which refers to the second column in the Origin default worksheet. During data analysis, the dataset name is used as a variable in calculations. This means you cannot have more than one column with the same name within the same worksheet. Since the dataset is a combination of the worksheet window name and the column name, you can have the same column name within different worksheets. To safeguard this, no two Origin windows can have the same name. However, you can have more than one column within the same window/worksheet that have the same column label.

In Origin versions 4 and 5 you can copy an entire worksheet window. This includes the worksheet column names and labels. First click on the worksheet that you want to duplicate to set it as the active window. Next select Window: Duplicate from the Origin Menu Bar. Alternatively, you can click on the Window Duplicate Icon, which is found on the Standard Origin Toolbar. The Win -D LabTalk command can also be used to duplicate the active window. The use of LabTalk is discussed further down the page.

There is no menu item that will copy the data and the column label at the same time. If you want to automate the copying of a column of data along with the label you will have to utilize the Origin LabTalk scripting language. You can run the script from a file or a button. A complete explanation of this is found in the Origin LabTalk manual. This is the only way to copy the data within a column along with the dataset label. For testing LabTalk script, you can cut and paste the following script into the Origin Script Window. Highlight the script and press the "ENTER" key. Before you do this make sure that you have created two worksheets. One should be named Data1 and will contain the data you want to copy along with the worksheet labels. The second worksheet should be called data2 and needs to contain just the default two columns.

What this script will do is as follows:
1. The first line of code will set the data2 worksheet to display column labels.
2. The next line of code will copy the data from column two of the data1 worksheet and place these numbers in the first column of the data2 worksheet.
3. The last line of code will copy the worksheet column label from the second column of the data1worksheet and place the label in the first column of the data2 worksheet.

data2!wks.LABELs(1);
copy data1_B data2_A;
data2!WKS.COL1.LABEL$=data1!WKS.COL2.LABEL$;

Much of the information needed to manipulate data within the worksheet can be found on page 335 of the Origin Version 5 LabTalk manual. This is also available using the on-line LabTalk help file by selecting the HELP INDEX with keyword WKS

[This message has been edited by scottp (edited 02-04-99).]

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