T O P I C R E V I E W |
carat64 |
Posted - 11/29/2007 : 02:05:38 AM Origin Version (Select Help-->About Origin): 6.0 Operating System: Windows XP
HI,
I have several ASCII files containing data in the format of two columns (X and Y) with 640 rows per column, however it is actually 64 sets of independent data (10 data points each). I need to plot each one independently so that I can fit it with the nonlinear curve fitting. Therefore, how can I convert the two columns into 64 (x2) columns which are also alternately set as X and Y column types? Is there also an easy way to use a label in a column as the column label in the transformed data set?
thanks!!!
Cara |
4 L A T E S T R E P L I E S (Newest First) |
carat64 |
Posted - 12/02/2007 : 1:05:28 PM Thanks Mike!
(I haven'tused Origins in a while (obviously)--thanks for the reminder!)
Cara
|
Mike Buess |
Posted - 11/30/2007 : 12:53:19 PM To execute from the script window select all lines of script and press Enter. The active worksheet must have two columns and 10x64=640 rows. I get no command errors under those conditions.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 11/30/2007 1:07:58 PM |
carat64 |
Posted - 11/30/2007 : 12:34:53 PM Hi,
Thanks for your help. When I enter the script in the script window (remove the last semicolon) and hit enter, I get a command error. Same thing if I highlight the data and then hit enter in the script window.
Cara
|
Mike Buess |
Posted - 11/29/2007 : 10:55:44 PM Hi Cara,
quote: how can I convert the two columns into 64 (x2) columns which are also alternately set as X and Y column types?
Use the script at bottom of this page.
quote: Is there also an easy way to use a label in a column as the column label in the transformed data set?
I'm not sure what that means but this script copies the column labels from imported to transformed columns...
specSize = 10; // # rows per set nSpecs = 64; // # sets work -d; // duplicate worksheet work -a 2*(nSpecs-1); // add more columns set %H -er wks.maxrows; // set their size %L=wks.col1.label$; // get column 1 label %M=wks.col2.label$; // get column 2 label loop(i,1,nSpecs-1) { rov = 1 + i*specSize; // next set starts here wks.col$(2*i+1).type = 4; // odd # columns are X wks.col$(2*i+1).label$ = %L; // set odd column label wks.col$(2*i+2).label$ = %M; // set even column label copy -b rov col(1) wcol(2*i+1) -b 1 -e specSize; copy -b rov col(2) wcol(2*i+2) -b 1 -e specSize; }; set %H -er specSize; // remove extra rows
Mike Buess Origin WebRing Member |