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 for Programming
 LabTalk Forum
 extract rows from worksheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

zangyef

Italy
Posts

Posted - 04/05/2006 :  04:29:59 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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



Go to Top of Page

zangyef

Italy
Posts

Posted - 04/05/2006 :  08:21:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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..

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 04/05/2006 :  09:11:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

zangyef

Italy
Posts

Posted - 04/05/2006 :  09:59:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much.
All works well.

Go to Top of Page

Flavs

Spain
Posts

Posted - 10/28/2006 :  07:32:46 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 10/28/2006 :  07:54:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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