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 for Programming
 LabTalk Forum
 Importing and processing excel files via LabTalk
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

johannes91131

Germany
4 Posts

Posted - 11/06/2013 :  03:14:15 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,
i´m a student and trying to compose a script allowing me to import about 200 various excel files, which all contain 2 columns of data, that I would like to be plotted in a simple XY graph. I already got some pieces of the script written, however am still struggling with the import of the files and a suitable loop so that all imported files get plotted the way I want it to.Can you help me please?
I´m using Origin Pro 9G. Would be grateful for any help.
Regards
johannes91131

greg

USA
1379 Posts

Posted - 11/06/2013 :  10:47:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Here is some basic code:

dlgfile gr:=Excel mu:=1;
loop(ii,1,fname.GetNumTokens(CRLF))
{
file$ = fname.GetToken(ii,CRLF)$;
// Customize Excel import options as needed
impExcel fname:=file$
lname:=1
desig:=<Unchanged>
options.names.FNameToBk:=0;
plotxy (1,2) plot:=200;
}
Go to Top of Page

johannes91131

Germany
4 Posts

Posted - 11/07/2013 :  07:28:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thank you very much.
the script works perfectly fine. now I was asked to add a 3rd column of data to the existing two columns of the excelf files and plot column 2 as x-axis and column 3 as y-axis in a seperate graph window and not together into one. How can I tell the program to use one active worksheet and plot two different graphs from its data into two seperate graph windows. greg could you help me out one more time please?
Regards
johannes91131
Go to Top of Page

greg

USA
1379 Posts

Posted - 11/18/2013 :  3:34:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Use something like:
plotxy iy:=[Book1]Sheet2!(2,3) plot:=200 ogl:=[<new template:=MyLine>]
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