Author |
Topic  |
|
zangyef
Italy
Posts |
Posted - 04/05/2006 : 04:29:59 AM
|
Origin Version: 6.0 Operating System: WinXP HE
Hi everyone. I want exctract rows, each with the same distance from the other, from a large worksheet and copy them to a new worksheet. Is there a simple way to do this? Thank you
|
|
zachary_origin
China
Posts |
Posted - 04/05/2006 : 07:28:40 AM
|
I think the most simple way is using Extract Worksheet Data (menu: Analysis\Extract Worksheet Data). Set the condition as mod(i-1, 5)==0 , where 5 is the distance from the other.
Zachary OriginLab GZ Office
quote:
Origin Version: 6.0 Operating System: WinXP HE
Hi everyone. I want exctract rows, each with the same distance from the other, from a large worksheet and copy them to a new worksheet. Is there a simple way to do this? Thank you
|
 |
|
zangyef
Italy
Posts |
Posted - 04/05/2006 : 08:21:29 AM
|
Thank you Zachary, this is excatly what Origin has to do but there's a way to do that with labtalk? I tried with some for loop but with no results..
|
 |
|
Mike Buess
USA
3037 Posts |
Posted - 04/05/2006 : 09:11:57 AM
|
Probably easiest to duplicate the worksheet and remove the rows you don't want...
rep=5; // keep every 5th row wo -d; // duplicate wks for(i=wks.maxrows;i>0;i--) { if(mod(i,rep)) mark -d col(1) -b i -e i; // delete row };
Mike Buess Origin WebRing Member |
 |
|
zangyef
Italy
Posts |
Posted - 04/05/2006 : 09:59:35 AM
|
Thank you very much. All works well.
|
 |
|
Flavs
Spain
Posts |
Posted - 10/28/2006 : 07:32:46 AM
|
I use this strategy to work with my datafiles, basically I have a lot of sets of mesurements in one worksheet and I separte them duplicating the worksheet and deleting with mark -d all the rows that I dont want. The problem is that my original worksheet has like 20000 rows, so after duplicating and erasing I have 20 worksheets with the proper data but although I am only using 1000 rows of each worksheet, the size of the worksheets is 20000 rows, of course 19000 of them are empty. This result in my origin projects being huge ( aroun 600 MB ). So I have 2 questions, how do I delete this empty rows? and Am I right in thinking that my files are so big due to excesive size of worksheets with empty rows?
Thanks, Flavio. |
 |
|
Mike Buess
USA
3037 Posts |
Posted - 10/28/2006 : 07:54:21 AM
|
Hi Flavio,
Yes, a worksheet with 20000 rows takes up much more memory/disk space than one with 20 rows. Use set %H -er wks.maxrows to delete the empty rows at the bottom. If you are extracting periodic rows then you might find the method discussed here useful...
http://www.nmrtools.com/labtalk/i_decimate.html
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 10/28/2006 08:03:27 AM |
 |
|
|
Topic  |
|