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
 breaking up files

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
jspector Posted - 03/28/2008 : 2:25:12 PM
Origin Version (Select Help-->About Origin): 7.5
Operating System: XP


I have imported an ascii file into worksheet "Data1".
I want to break the file up into a number of pieces the user specifies, and put them each in their own worksheet.
I've got it set up now where it asks how many worksheets will need to be created and it creates them. My question, is how do I assign values to
a worksheet based on what is in another worksheet ? What I mean is say Data1 1 has 3 columns each of 100 rows, and I want worksheet Data2 to have the values from rows 1-23 of Data1, Data3 to be 24-75 and Data4 to be 76-100

Can someone help ?
thanks,
-Jeff
2   L A T E S T    R E P L I E S    (Newest First)
jspector Posted - 03/31/2008 : 11:51:03 AM
Thanks! I got it to work just before I read your reply, but your code is much neater than mine is..
-jspector
Deanna Posted - 03/31/2008 : 02:35:15 AM
Hi Jeff,
I have written an example below. It shows you how to copy Row 11 to 23 of the first column of the Data1 worksheet to the 1st column of the Data2 worksheet. Maybe you can rewrite it as you need.



void test6710()
{
Worksheet wksSrc("Data1"); // Create Origin C Worksheet object and attach to Origin Data1 worksheet
Dataset dsSrc; // Create unattached Dataset object
dsSrc.Attach(wksSrc, 0); //Attach to the first column of Data1

Dataset dsCopy( dsSrc); //Make a copy of the source data
dsCopy.SetLowerBound(10); //From Row 11
dsCopy.SetUpperBound(22); //To Row 23
dsCopy.TrimLeft(TRUE);

Worksheet wksDst("Data2");
Dataset dsDst; // Create unattached Dataset object
dsDst.Attach(wksDst, 0); //Attach to the first column of Data2

dsDst = dsCopy;

}


Deanna
OriginLab Technical Services

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