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
 deleting rows
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Fanning

UK
10 Posts

Posted - 04/10/2014 :  04:48:14 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear all,

I have a large data sets, for each one the first 500 rows are just noise. At the moment, I am deleting them manually, but if anyone can help me to write a script, that would be much appreciated.

Thank you very much in advance!

Regards

Fanning

SeanMao

China
288 Posts

Posted - 04/10/2014 :  05:58:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Fanning,
I wrote a simple code below which might serve your purpose:

doc -ef W {
   doc -e LW {
range aa =1[1]:4[500];
      del aa;
   }  
}
//It will loop over all worksheets in all workbooks and delete first 500 rows from column 1 to column 4.


Regards!

Sean

OriginLab Tech Service
Go to Top of Page

Fanning

UK
10 Posts

Posted - 04/10/2014 :  06:22:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Sean

Thank you very much for your quick reply. It works exactly as you said! can I ask for one more favor: is it possible to omit the range of column step? my data sets have different column numbers, would be nice if i can process the data regardlessly.

Thanks again

Fanning
Go to Top of Page

greg

USA
1378 Posts

Posted - 04/10/2014 :  10:01:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This line:
range aa = 1[1]:$(wks.ncols)[500];
includes column 1 [row 1] to "last column" [row 500]
Go to Top of Page

Fanning

UK
10 Posts

Posted - 04/11/2014 :  06:29:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Greg. it works like a treat!
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