Hi Cara,
Copy and paste the following lines of code to your script window, then highlight all lines, and hit enter to execute. Make your source worksheet the active page before running the code. The 3rd row from your source worksheet will be extracted - this number 3 is hard coded here. You can change as needed. Also you can look up LabTalk help to see how you can place this code in an OGS script file section and call it from script window, in which case you could pass a parameter for desired row, rather than hard coding it.
Easwar
OriginLab
// Save name of active sheet to variable %a
%a = %h;
// Get number of columns in active sheet;
icols = %a!wks.ncols;
if( icols < 2 ) return;
//
// Create a new worksheet
win -t;
// Loop over all columns of source worksheet...
irow = 1;
for( ii = 2; ii <= icols; ii++ )
{
// Get label string of current column from source wks
%b = %a!wks.col$( ii ).label$;
// Place label in 1st col of new wks
%( %h, 1, irow ) = %b;
// Place value from "3rd" row of source wks into 2nd column of new wks
%( %h, 2, irow ) = %( %a, ii, 3 ); // change 3 to desired row number of source sheet
// Look in LabTalk help files on how to pass row num as argument to an OGS section
irow++;
}
Edited by - easwar on 10/26/2004 5:15:43 PM