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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 how to deal with multiple data files?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

qingkite

UK
Posts

Posted - 11/26/2007 :  11:57:44 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Mike Buess

USA
3037 Posts

Posted - 11/26/2007 :  9:19:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

qingkite

UK
Posts

Posted - 11/27/2007 :  10:40:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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;

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 11/27/2007 :  12:24:14 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

qingkite

UK
Posts

Posted - 11/27/2007 :  5:59:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks so much for your kind help. I've got all the results. thanks.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000