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
 Importing Datasets with an Origin-C-code

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
markus.w Posted - 04/23/2012 : 08:51:52 AM
Hello everybody,

I want to handle the following task, but I am not really an advanced programmer so I hope you guys can help me and/or give me some advice and inspiration:

I have a set of datas , they are all of the same structure, so I
want to make a routine that creates me everything.

This datafiles represent meassurement of Voltage and Power.

I need from each datafile the first line of meassurement (voltage and power) and write every first line in one new book, and then from every datafile the second line and write it again in a new book and so on for all lines.
So, if I have e.g. 50 lines in each datafile, there are at the end 50 books.

Thanks for Helping!
LG Markus



1   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 04/24/2012 : 02:49:22 AM
Hi,

From your description, I think you can first import your data into a worksheet first, and then re-arrange the data into different workbook, which will be more easier.

After importing the data into a worksheet, you can run the following script to put one line into a new workbook. Also, you can put the script for running after importing. Please note, the data is copied from one line to the first line of new book. If you have different requirement, you need to change the corresponding script.

string strBookName$ = %H;  // get the original book name
int nRows = wks.maxRows;
int nCols = wks.nCols;
for(nRowIdx=1; nRowIdx<=nRows; nRowIdx++)
{
	range rrSr = [strBookName$]1!col(1)[nRowIdx]:col($(nCols))[nRowIdx];  // source row
	newbook;  // create a new book
	wks.nCols = nCols;
	range rrDe = col(1)[1]:col($(nCols))[1];  // destination row
	copydata rrSr rrDe;  // copy data
	sec -p 0.1;  // pause for 0.1 second
}
win -cd %(strBookName$);  // delete the original book


Penn

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