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
 Origin Forum
 Crop/trim a worksheet or matrix
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

AKazak

Russia
1205 Posts

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

ChaoC

USA
178 Posts

Posted - 04/05/2022 :  3:58:48 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 04/05/2022 :  10:06:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Chao,

Thank you for providing the detailed information on the topic.

---
Andrey
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