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
 Extraction of data from a column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Coder12

3 Posts

Posted - 02/14/2018 :  7:20:58 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Origin Pro 8.1 SR3
Operating System: Win7

Hi everyone. I have the following problem:

I have a lot of data in Col(A). I now want now only to use a certain range of rows - lets say from row aa to row bb - in Col(A). The rest can be discarded. I tried the following script (and variations thereof):


int aa = "some variable defined by other parameters"
int bb = "some variable defined by other parameters"
range Data = 1[aa:bb];
Col(B) = Data;
delete Col(A);


Either nothing really happens or the entirety of Col(A) is copied to Col(B). How can I put variables as parameters into a range? It should be possible, right?
Also, if you have suggestions how to more elegantly solve my goal (eg extract data from a column), then I would rally appreciate it.

I wanted to add that I already "achieved" my goal by copying the individual cells via a for-loop. However, considering that my datasets can range between 1-4 million, I am pretty sure that this approach will be way to time consuming.

Edited by - Coder12 on 02/14/2018 7:23:27 PM

Hideo Fujii

USA
1582 Posts

Posted - 02/15/2018 :  10:21:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Coder12,

You code works in my Origin 2018. Probably because of the bug in Origin 8.1? If you wonder, you can install
and try Origin's latest Evaluation version.

--Hideo Fujii
OriginLab

P.S. Note that according to your code, if the column B was filled by lots of values, original data remain after
(bb-aa)-th row.

Edited by - Hideo Fujii on 02/15/2018 10:24:49 AM
Go to Top of Page

Coder12

3 Posts

Posted - 02/15/2018 :  11:29:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Hideo Fujii

Hi Coder12,

You code works in my Origin 2018. Probably because of the bug in Origin 8.1? If you wonder, you can install
and try Origin's latest Evaluation version.

--Hideo Fujii
OriginLab

P.S. Note that according to your code, if the column B was filled by lots of values, original data remain after
(bb-aa)-th row.


Huh. Good to know about the bug. I will try a more recent version of Origin. And I plan on later deleting Col(A) (or just deleting the rows in Col(A) that do not interest me).
Thanks for your help!
Go to Top of Page

Coder12

3 Posts

Posted - 02/15/2018 :  12:35:58 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I upgraded to Origin 8.6 SR2 b98.
However, it does not resolve the issue. Is it even possible to use int variables as parameters for a range variable (I mean, it should be)?

Edit: Nevermind! I just messed up the syntax when I tested it in Origin8.6. It now works as intended, thank you very much.

Edited by - Coder12 on 02/15/2018 12:46:48 PM
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