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
 Origin Forum
 Template for Workbook?

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
b.franze Posted - 08/30/2012 : 04:43:51 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.5G
Operating System: Win XP

Dear all,
I am working in a analytical chemistry lab and am dealing with lots of data files. Due to instrument export features I am only able to export my measured data with x and y values following each other in ONE column, like this:

column1

time0
time1
time2

value0
value1
value2

as I need to have those data in 2 columns I am looking for a way to handle lots of those raw data files in one click. By now I need to add each column manually and calculate the column values into this new column in order to get the typical form like this:

column1 column2
time0 value0
time1 value1

Is there any possibility to write a template for this purpose like it is the case for a diagram in the design manager?

I appreciate any help. Thank you in advance.

2   L A T E S T    R E P L I E S    (Newest First)
Drbobshepherd Posted - 08/30/2012 : 11:15:18 AM
For this task, I reccommend an Import Filter with a LabTalk script.

Use the Import Wizard to create an import filter for your data. Check "Save Filter" on the Save Filters page of the Import Wizard window, then check "Specify advanced filter options". Enter the following lines:

ii=wks.maxrows/2+1; // 1st value row number.
jj=wks.maxrows; // Last value row number.
%A=$(ii); // Convert to string register.
%B=$(jj); // Convert to string register.
range y1=col(A)[%A:%B]; // Declare range for y-values.
col(B)=y1; // Copy y-values to col(B).
wks.nrows=wks.maxrows/2; // Delete unnecessary rows.

Then click on "Finish". The file should import and the data will automatically transfer to col(B). I am assuming column1 is written to the column heading, so col(A) contains time-values stacked on top of your y-values, no blank cells. You can adjust the index values for ii and jj if you need to.

Once you get the import filter working the way you want, try dragging and dropping your files from a MS directory window into the Origin Workspace. This is a very efficient way to process a lot of files.

Let me know if this works for you.

DrBobShepherd
Hideo Fujii Posted - 08/30/2012 : 10:46:27 AM
Hi b.franze,

You can put your script to the "Script Panel" of a (3-column) worksheet (right-click in the gray area in the worksheet, and choose "Show Script Panel" shortcut), then save it as a worksheet template. Sample script may be like as follows:

delete col(3);
delete col(2);
worksheet -a 2;
range c1=col(1);
range c2=col(2);
range c3=col(3);
nr=c1.getSize(); //number of rows
range r1=col(1)[1:$(nr/2)];    //1st half
range r2=col(1)[$(nr/2+1):nr]; //2nd half
c2=r1;  //copy 1st harf
c3=r2;  //copy 2nd half

When you open this template from the Template Library, the Script Panel with the code should appear. If you enter the data in the first column, and press "Execute All" button in the panel, it performs accordingly. (Note: Be aware that the bottom part of the data doesn't contain rows of missing values.)

Hope this helps.

--Hideo Fujii
OriginLab

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