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
 Origin Forum
 Crop/trim a worksheet or matrix

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
AKazak Posted - 04/05/2022 : 04:32:34 AM
OriginPro 2022 (64-bit) SR1 9.9.0.225
Windows 7 Pro SP1 x64

Greetings!

What is the correct function/method to crop/trim (delete rows and columns from the top/bottom and left or right) a worksheet or matrix besides manual row/column manipulation?

Thank you.

---
Andrey
2   L A T E S T    R E P L I E S    (Newest First)
AKazak Posted - 04/05/2022 : 10:06:45 PM
Dear Chao,

Thank you for providing the detailed information on the topic.

---
Andrey
ChaoC Posted - 04/05/2022 : 3:58:48 PM
Hi Andrey,

I have three ways of doing this.
First, you can specify the rows and columns you want to keep during import if it is csv/ASCII using the Partial Import option.


OR if you used the csv import connector, you can go back and select a partial import.


Second, you can use Worksheet>Worksheet Query....
Give a test condition that is always true, like 1=1.
Unselect the columns you want to trim on the left and enter the rows you want to keep. This method does not modify your dataset as the data is extracted to another worksheet/workbook.


Third, you can use the X-Functions wreducecols and wreducerows. For example, let's say we have a worksheet with 32 rows and 10 cols. If you want to trim the first 3 rows, you would use:
wreducerows end:=4 nrows:=3. If you want to want to trim the last 2 columns, you would use:
wreducecols start:=9 ncols:=2. Notice the "start" is inclusive and "end" is exclusive. This method would alter your original dataset.

Chao

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