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
 how to deal with multiple data 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
qingkite Posted - 11/26/2007 : 11:57:44 AM
Origin Version (Select Help-->About Origin): origin 7.5
Operating System: winXP

hi, all, i have multiple data files (81 files) and want to deal with them in the same way. is there a simpler way to do it, for example, a function which can record the data process and all i need to do is to replay it to all the other files?



here is the first file. i need to calculate the area ratio of the peak on th left to the one on the right in each file.

thanks a lot.

all the bests
jingjing
4   L A T E S T    R E P L I E S    (Newest First)
qingkite Posted - 11/27/2007 : 5:59:35 PM
Thanks so much for your kind help. I've got all the results. thanks.
Mike Buess Posted - 11/27/2007 : 12:24:14 PM
quote:
could you please tell me how to index a peak in the Labtalk script.
The indices are just the row numbers between which you want to integrate. You can use the Data Reader tool on a sample data plot to determine the indices.



Mike Buess
Origin WebRing Member
qingkite Posted - 11/27/2007 : 10:40:01 AM
Thanks very much for the helpful reply, but could you please tell me how to index a peak in the Labtalk script. I'm just a beginner at Origin, not very sure about the right way.

thanks in advance for your kind help.



[quote]
Origin has no macro recorder but programming your processing steps is straightforward. If you can import your files with the Import ASCII routine then the following LabTalk script will import, plot, integrate and report areas to the Results log for as many files as you choose. You can run the script from the Custom Routine button.

getnum
(Start 1) i1
(Stop 1) i2
(Start 2) j1
(Stop 2) j2
(Enter peak indices...);
FDLOG.UseGroup(Ascii);
if (FDLOG.multiopen()==0/0) return 1;
savered=type.Redirection(16,3);
type.BeginResults();
type "Peak1: $(i1) --> $(i2)";
type "Peak2: $(j1) --> $(j2)";
type "File\tArea1\tArea2\tA1:A2";
separator 4;
loop(ii,1,FDlog.MultiOpen.Count)
{
FDlog.Get(A, ii);
win -t data; // new worksheet
open -w %A; // import
%W=%H; // save wks name
FDlog.Get(A,ii,1); // file name without extension
win -t plot; // new graph
layer -w %W 200; // line plots
integrate -a %C -b i1 -e i2; // integrate peak 1
a1=integ.area; // save area 1
integrate -a %C -b j1 -e j2; // integrate peak 2
a2=integ.area; // save area 2
type "%A\t$(a1)\t$(a2)\t$(a1/a2)"; // type results
plot -c; // refresh graph
};
separator 4;
type.EndResults();
type.Redirection=savered;

Mike Buess Posted - 11/26/2007 : 9:19:29 PM
Origin has no macro recorder but programming your processing steps is straightforward. If you can import your files with the Import ASCII routine then the following LabTalk script will import, plot, integrate and report areas to the Results log for as many files as you choose. You can run the script from the Custom Routine button.

getnum
(Start 1) i1
(Stop 1) i2
(Start 2) j1
(Stop 2) j2
(Enter peak indices...);
FDLOG.UseGroup(Ascii);
if (FDLOG.multiopen()==0/0) return 1;
savered=type.Redirection(16,3);
type.BeginResults();
type "Peak1: $(i1) --> $(i2)";
type "Peak2: $(j1) --> $(j2)";
type "File\tArea1\tArea2\tA1:A2";
separator 4;
loop(ii,1,FDlog.MultiOpen.Count)
{
FDlog.Get(A, ii);
win -t data; // new worksheet
open -w %A; // import
%W=%H; // save wks name
FDlog.Get(A,ii,1); // file name without extension
win -t plot; // new graph
layer -w %W 200; // line plots
integrate -a %C -b i1 -e i2; // integrate peak 1
a1=integ.area; // save area 1
integrate -a %C -b j1 -e j2; // integrate peak 2
a2=integ.area; // save area 2
type "%A\t$(a1)\t$(a2)\t$(a1/a2)"; // type results
plot -c; // refresh graph
};
separator 4;
type.EndResults();
type.Redirection=savered;

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 11/26/2007 9:20:23 PM

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