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
 Forum for Origin C
 Origin C with Import Wizard
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

a.abc.b35

175 Posts

Posted - 01/07/2011 :  6:22:51 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi, I have 10 ASCII files,each with two columns : column1 and column2 (say). column1 is angle in degree and column2 is Intensity. I am able to import the data to a workbook with 10 worksheets. But now I want to do a bit more.
1)I want to convert the column1 to radians (i.e multiply column1 by a constant) and also add another column3 after column2 which will be sqrt(column2) and set as the error of column2.
2) If the above is done, than I want to plot the radians vs Intensity (converted column1 and column2 along with the error bars in column3) to 10 XY graphs.
...
I am using the import wizard and there I see a option of including a origin c code. But I dont know how to write the code for the things I want to do. Can anyone help me please ?

AB

easwar

USA
1964 Posts

Posted - 01/11/2011 :  10:21:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi AB,

You can do this by writing some LabTalk script code on the Advanced Options page of the Import Wizard:
http://originlab.com/www/helponline/Origin/en/UserGuide/Import_Wizard_Advanced_Options_Page.html

Then you can save the filter and use that filter to import multiple files, and at the end of each file import, the script will run to transform your data and plot the data. There are script functions such as plotxy to plot data, so you can look up scripting documentation for that. If you need further help post again or contact tech support.

Easwar
OriginLab
Go to Top of Page

a.abc.b35

175 Posts

Posted - 01/12/2011 :  03:05:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Well, I am more comfortable with Origin C. Labtalk script, I just have no idea when it comes to right a little bit involved things. I have written a somewhat lengthy program in Origin C and my problem is solved partially. only problem is, my worksheets now have 5 columns instead of 3 .which, though not a problem,still eats up more memory. I have created a template and saved it. The template has 5 columns, last 3 of which is set to auto calculate by the formulas : x2 = pi/180* x1; y2 = y1; dy2 = sqrt(y2). Now the origin c code i wrote, it puts data in the 1st two columns,for each ASCII file, it creates a worksheet in the workbook, and does the math. But I dont think the code i worte is a efficient one and may be if you look at it, you can make it better. Would you like me to send the code to you ?


AB
Go to Top of Page

easwar

USA
1964 Posts

Posted - 01/12/2011 :  11:39:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi AB,

So you are using Origin C code to find and import the 10 files, and then your OC code uses an Import Wizard filter?

If you want to keep everything in OC, you could still use OC to import the raw data, and after the import is finished, use OC to manipulate the data by creating the new columns and deleting unwanted columns etc.

If you need more help contact tech support directly.

Easwar
OriginLab
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