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
 Batch process with constant columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

AdamJH

2 Posts

Posted - 06/17/2013 :  4:43:23 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I want to set up a batch process where two columns are imported from a plain text file, columns A and B. Column B is then multiplied by a column of constant values, column C, producing column D. The multiplication was done using set column values.

The batch process import works fine, but deletes column C. I tried using set column values:

col(c) = range f2011x10

with script

range f2011x10 = [book1]"sheet1"!col(B)

But this simply deletes column B in the sheet I want to copy from.

I also tried a script in the import filter, but this did not work either.

I am at a bit of a loss on how to do this, any help would be greatly appreciated.

Adam

snowli

USA
1379 Posts

Posted - 06/17/2013 :  5:53:01 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Adam,

Maybe the best would be you send your opj or template and one sample text file to tech@originlab.com?

The syntax you used is wrong. Don't add "range" after = sign in formula box in Set Column Values. When u use the syntax, did it work?

You mentioned col(C) are some constant values. Do you mean it's some constant values from Book1 sheet1 col(B)? So the worksheet you want to set formula on isn't book1 sheet1? Is it another sheet in book1 or a new workbook, e.g. Book2?
You may not need to have col(C) then. U only need to add one extra column. In Set Column Values dialog
Before formula script as:
range f2011x10=[book1]"Sheet1"!col(B)

Formula as
f2011x10*coL(B) so book1 sheet1's column B times current sheet's column B.

Have you look at our Set Column Value related videos on our website? E.g. This video may help.
http://www.originlab.com/Index.aspx?go=Support/VideoTutorials&pid=2009

Thanks, Snow Li
OriginLab Corp.

Edited by - snowli on 06/17/2013 5:55:20 PM
Go to Top of Page

AdamJH

2 Posts

Posted - 06/18/2013 :  03:10:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks,

I just got the syntax wrong when typing it into the forum box, it was without range in the workbooks, and does not work.

The formula you suggested works, but causes the save workbook as analysis template option to be greyed out, so it can not be saved for batch process.
Go to Top of Page

snowli

USA
1379 Posts

Posted - 06/18/2013 :  09:51:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Adam,

Do you mean you have Book1, Sheet1 with col(B) values.
Then you want to import multiple text files to new workbooks or worksheets and add a new column (C) in each new worksheet which equals col(B) of Book1 sheet1. Then add new col(D) where each has col(C)*col(B) of current sheet?

I did try save as analysis is grayed out when using the syntax i suggested below. So I will check what may be the cause.

But at the same time, I think using Import wizard to import multiple text files will be fine.

E.g. E.g. u already have Book1, Sheet1. And col(B) is filled with constant values.
Click Import wizard.
Select multiple text file u want to import.
Choose Import Mode: Start New Books or Start New Sheets.
On the last page, check Save Filter.
Give a Filter file name. e.g. add_columnC&D

Check Specify advanced filter options checkbox and click Next button.
Enter the following script to run at the end of each import.
range f2011x10 = [book1]"sheet1"!col(B);
col(C)=f2011x10 ;
col(D)=col(C)*col(B);
Click Finish.
--> All files will be imported with col(C) and col(D) calculated as well.

U can use this filter in the future to import such data and get col C and D.

Thanks, Snow
Go to Top of Page

snowli

USA
1379 Posts

Posted - 06/19/2013 :  1:32:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Adam,

We discussed more about this issue and will try to fix it for coming 9.1.

The bug jira number is https://originlab.jira.com/browse/ORG-8874

Thanks, Snow Li
OriginLab Corp.
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