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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Delete empty rows at the end of a wks

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
LarsVSA6 Posted - 10/07/2003 : 02:22:31 AM
Hello,

can i delete empty rows at the end of a wks by a script, as i can do by hand? (At least down to the 30 rows of the standard value)

I try to use the mark -d Mywks_B (or every other column) -b firstemptyrow -e endofwks command, but this does not work for empty rows.

I want to use this, because i have a wks-file with for example 17 measurements, each measurement with different numbers of rows and in the sum up to 1500 rows. I want for every measurement a single wks. Until now, i do it by a script in the way like this:

first step: duplicate the original wks and change the name to the first measurement

second step: delete all rows behind the first measurement contains data with the mark command in the duplicated wks

third step: delete all rows of the first measurement in the original wks

and so on...

Before i start to duplicate with the first step there is a loop through the original wks to find out the number of rows for every measurement.

The result at the end is, that i have 17 wks but all with the same numbers of rows as the original one, and of cause the most of them are empty. Also they are empty ones, they cost a lot of diskspace and the *.opj-file increase in size, and for further calculating of the data in the worksheet it cost much more time.

Thank you for an answer,

Lars.
4   L A T E S T    R E P L I E S    (Newest First)
St-Ranger Posted - 01/03/2004 : 7:59:25 PM

I just realized that I also need to clean multiple worksheets in several Origin projects from empty rows. So, I wrote a script that maybe will be useful to somebody with similar needs (as Lars was).
This script cuts off all zero rows. It does not seem to remove empty lines in the middle of the datasets, although I did not do a thorough testing.

doc -e W {
nRows=%H!wks.maxRows;
set %H -er $(nRows);
};



In case you might have an empty worksheet, the following modified script will not break on such a worksheet and will inform you about the name of that empty window, but will not do anything to it.


doc -e W {
nRows=%H!wks.maxRows;
if (nRows > 0) {
set %H -er $(nRows);
};
else {
type (%H worksheet is empty);
};
};


For me, a few projects became 2-3 times smaller.

PS.
Mike, thanks for your earlier response. I just didn't want to waste the traffic for a separate "thank you" note.

Mike Buess Posted - 11/10/2003 : 2:12:20 PM
It's just a matter of the wks window size. Empty space is not allowed at the bottom of the wks window, so if 20 rows will fit in the window you'll get at least 20 rows. If you shrink the window such that only two rows are visible you can reduce the number of rows to 2. But stretching the window will create rows to fit.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 11/10/2003 2:13:07 PM
St-Ranger Posted - 11/10/2003 : 12:37:43 PM
quote:

Hi Lars,

This will set the number of rows in Data1 to nRows...

set Data1 -er nRows;

Mike Buess



This works on a large wks, but doesn't seem to work on small worksheets (I just tried to do it on a 20 raw wks, to cut it down to 7), at least in Origin 6.0 SR4.
I wonder, is it because of a minimum size of a wks, or why?

Thanks.


Edited by - St-Ranger on 11/10/2003 12:44:26 PM
Mike Buess Posted - 10/07/2003 : 07:40:17 AM
Hi Lars,

This will set the number of rows in Data1 to nRows...

set Data1 -er nRows;

Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000