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
 Forum for Origin C
 Copy Column from Worksheet "A" to WS "B"

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
Hellron Posted - 08/17/2007 : 04:15:34 AM
Origin Version (7.5):
Operating System: Win 2000

Hello,

I'm pretty new to Origin an C aswell. For my little internship
@ Infineon AG I've to use Origin an C (btw. just started to learn C)
so it's perhaps a "noob" Question but well...

I need to copy different Columns from one Worksheet to another and paste it there. In detail: I've got three Workseet's "Data", "Data1", "Data2" and from each Worksheet I need Colmun 3,10, 17 and so on and copy it to a Worksheet called "Mittelwert" to a Column named "ID". In this colum the copied Data shoult added to the Data in the Colum to get the average later.

Would be nice, if someone could help me there!

Thank's a lot!

5   L A T E S T    R E P L I E S    (Newest First)
Hellron Posted - 08/21/2007 : 01:35:47 AM
Good morning :)

Well it try that - could be that there is a difference in the amount of the dataset. But the problem is: I need the clause for 3 Datasets. So dsVD11, dsVD12 and dsVD13 - same with ID and so on. I've about 50 Dataset's so it wouldn't bei nice to do that if - clause for 50 Set's. Is there anoter way?

cYa - Ingo

Edit2: Well' I think I got that solved... Hope ther is no other prob upcoming.

Edited by - Hellron on 08/21/2007 02:25:44 AM

Edited by - Hellron on 08/21/2007 03:59:24 AM
Mike Buess Posted - 08/20/2007 : 10:00:41 AM
dsVD11 and dsVD12 are probably not the same size. That is, the columns to which they are attached do not have the same number of rows. You can pad the shorter column with zeros like this...
	int n1 = dsVD11.GetSize();
int n2 = dsVD12.GetSize();
if( n1>n2 )
dsVD12.InsertAt(n2,0,n1-n2);
if( n2>n1 )
dsVD11.InsertAt(n1,0,n2-n1);
dsVD1PUT = (dsVD11 + dsVD12)/2;

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 08/20/2007 11:46:15 AM
Hellron Posted - 08/20/2007 : 08:01:00 AM
Ok - still got a Problem. After I worked the thing out for couple of Worksheets I get an Error which I can't get lost of.

In this line:

dsVD1PUT = (dsVD11 + dsVD12)/2;

the programm (not the compiler) stops with this error (it's the line):

H:\My AppData\Origin Data\AKL_Greese\import.cpp(127) :Origin C Function Runtime Error, unknown error

It work's only if I change the line like this:

dsVD1PUT = dsVD11;

but that's not what I want because I need the averga value...

Hope you can help again!

Greetings, Ingo
Hellron Posted - 08/17/2007 : 10:55:51 AM
Well tank you very much - that's what I wanted to do. Ok, not exactly the same but pretty close! My problem was that I wasn't confirm how the dataset worked and well didn't use the right syntax.
I tried to do it with the Helpfiles but did it wrong somehow. I used the [ Dataset dsID.Attach("Data"); ] and that didn't work. Aswell as some other combinations.

Again, thank you - now I got to transfer it and change it to some varibales. Now I've to try to get the Dataset directly with the columnes. Hope that will work.

Thank you again! Made my day :)

Ingo
zachary_origin Posted - 08/17/2007 : 09:44:23 AM
Not very sure what did you mean exactly for "added to the Data in the column". However, to manipulate on the columns, you can write something like the following...


Worksheet wksData("Data");
Dataset dsA(wksData, 2); //in Origin C it starts as 0,
Dataset dsB(wksData, 9);
Dataset dsC(wksData, 16);
Worksheet wksMitt("Mittelwert");
Dataset dsID(wksMitt, 3); //assume column "ID" is the 4th column
dsID = (dsA + dsB + dsC)/3.0; //directly calculate with the datasets


you can search in the Help with keyword worksheet and dataset for more information...


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