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
 Avoid empty cells using wxt
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

JokerOne

Germany
58 Posts

Posted - 05/06/2016 :  07:43:11 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.9.1 and Service Release 1(Select Help-->About Origin):
Operating System: Win 7

Hello everybody,

I ran into the follwing somewhat strage result using wxt.
As a dummy code:

// create a worksheet with 1 to 1000 in col(a):
newbook Book1;
dataset aaa = {1:1:1000};
col(a) = aaa;

// Extract 1 line into new worksheet, e.g. the line with 123
// USE WXT:
wxt test:="col(a) = 123" ow:= Book2;

Now, the export works fine, but what strikes me is, that the new worksheet also contains 1000 rows of which 999 are empty.

Can this be avoided somehow using wxt?

In my scripts I am using wxt a lot to extract data from larger lists. I would like to keep the results worksheets small to avoid unnessary memory requirements for the huge "almost empty" worksheets.

Thanks for your help




Edited by - JokerOne on 05/06/2016 07:49:22 AM

SeanMao

China
288 Posts

Posted - 05/10/2016 :  03:40:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can workaround it by using script below:


wxt test:="col(a)<10" ow:=Book2 num:=number; // Output passed row number
wks.nrows=number; // Set destination row number as passed number


The basic idea is to output number of passed rows and then set destination row number as the number of passed rows.

Hope this can be some help!

Regards!

Sean

OriginLab Tech.
Go to Top of Page

JokerOne

Germany
58 Posts

Posted - 05/10/2016 :  05:55:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by SeanMao

Hi,

You can workaround it by using script below:
[...]
The basic idea is to output number of passed rows and then set destination row number as the number of passed rows.




Works! Thank you very much.
Go to Top of Page

phancao129

USA
1 Posts

Posted - 05/17/2016 :  11:09:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
We invite you to explore our site to learn more about who we are, what we do and how we can assist you and your loved ones. You will find a wealth of valuable information here, including videos and blog posts about topics that, over the years, many of our clients have asked about at our initial meetings.

http://assetprotectioncenter.com/


[url=http://assetprotectioncenter.com/]asset protection law[/url]
[url=http://assetprotectioncenter.com/]estate planning in california[/url]
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