Author |
Topic  |
|
linele
Germany
5 Posts |
Posted - 02/04/2009 : 10:04:00 AM
|
Hi everyone,
need a little help: after having imported an ASCII-file into Origin, it looks like that (wks1):
col(a) col(b) col(c) 800.000000 0.150582 9.277585e-002 825.000000 0.263400 8.201367e-002 ... 5000.000000 0.248629 6.084247e-009 800.000000 0.250582 7.277585e-002 ... 5000.000000 0.348629 7.084247e-009
I am looking for a script, which extracts each section in wks1 starting from 800 (till 5000) and inserts it into a new worksheet. The goal is to get several worksheets containing just one section 800-5000.
Thanks for your help!
|
|
VincentLiu
China
Posts |
Posted - 02/05/2009 : 02:28:19 AM
|
Hi Caroline,
You may try the X-Function "wxt" to get what you want. The following command is to show you how to extract the data to a new worksheet using "wxt".
wxt test:="col(a)>=800 & col(a)<=5000" ow:=<new>;
To use the command, you need to active your worksheet and then input the command in the Command Window. It will generate a worksheet called "extracted" which contains the extracted data. For more details about the function, please refer to
http://www.originlab.com/www/helponline/Origin8/en/mergedProjects/X-Function/X-Function/wxt.html
Please see whether it is can solve the problem. If not, please give us more details through
http://www.originlab.com/www/company/qform.aspx?s=1&
Best regards, Vincent Liu OriginLab Technical Services
|
 |
|
greg
USA
1379 Posts |
Posted - 02/05/2009 : 12:19:36 PM
|
I do not think Vincent's code is what you want. Here is a script that assumes your data groups are defined by increasing order:
// BEGIN SCRIPT %M = %H; wcols = wks.ncols; get col(1) -e last; val = 1e307; loop(ii,1,last) { test = %M!cell(ii,1); if( test < val && test != 0/0) { win -t data origin; wo -a wcols - wks.ncols; %N = %H; row = 1; } loop(jj,1,wcols) { %N!cell(row,jj) = %M!cell(ii,jj); } row++; val = test; } // END SCRIPT
The script has been optimized for version 7 and works in 8 as well. |
 |
|
linele
Germany
5 Posts |
Posted - 02/06/2009 : 02:56:12 AM
|
Thank you guys! |
 |
|
|
Topic  |
|
|
|