Author |
Topic  |
|
TryItOnceBa
USA
Posts |
Posted - 01/22/2008 : 3:45:39 PM
|
Origin Version (Select Help-->About Origin): OriginPro 8 Operating System: Windows XP Pro
Is there a simple way to repeat the operations on a single worksheet on all of the imported worksheets? For example, I need to repeat the following operations on every imported worksheets, each of them has two columns of ascii data:
1. add a new column: col(c) 2. set column value: col(c)=col(b)-2*col(a)
I guess Origin script would do the job but I have never used it before, your input is really appreciated. |
|
easwar
USA
1965 Posts |
Posted - 01/22/2008 : 4:46:36 PM
|
Hi,
One easy GUI solution is the following:
1> Start with a new book and import one file 2> Add the extra columns you need and set up column formula calculations for these additional columns - click and select column and then right click and select Set Column Values from the context menu Note: You can set the formula to automatically update by setting the Recalcualate drop-down to Auto 3> Optionally clear all the data by using the Worksheet->Clear Worksheet menu command 4> Save the book/sheet as a Template using the command File->Save Window As
So you basically built a template that has some computation included in it.
Then any time you want to import similar file, make a new instance of your saved template (use the File->Open menu or the Open Template button in the Standard Toolbar, and then import the new file into it. The data will come in and the secondary columns will be automatically updated/computed.
This procedure works for any analysis/operation where the results can be set to auto update, such as smoothing, curve fitting etc. This general concept of saving a template with updateable results is called "Analysis Template" in Origin 8.
Easwar OriginLab
|
 |
|
TryItOnceBa
USA
Posts |
Posted - 01/22/2008 : 7:35:30 PM
|
This "template" method is cool. Thanks a lot! I'm still hoping if there's a way of parallel processing all the data at the same time, importing hundreds of data files one by one is still quite tedious. When I tried to open template and import multiple ascii files, only the first one got the changes defined by the template.
quote:
Hi,
One easy GUI solution is the following:
1> Start with a new book and import one file 2> Add the extra columns you need and set up column formula calculations for these additional columns - click and select column and then right click and select Set Column Values from the context menu Note: You can set the formula to automatically update by setting the Recalcualate drop-down to Auto 3> Optionally clear all the data by using the Worksheet->Clear Worksheet menu command 4> Save the book/sheet as a Template using the command File->Save Window As
So you basically built a template that has some computation included in it.
Then any time you want to import similar file, make a new instance of your saved template (use the File->Open menu or the Open Template button in the Standard Toolbar, and then import the new file into it. The data will come in and the secondary columns will be automatically updated/computed.
This procedure works for any analysis/operation where the results can be set to auto update, such as smoothing, curve fitting etc. This general concept of saving a template with updateable results is called "Analysis Template" in Origin 8.
Easwar OriginLab
|
 |
|
cpyang
USA
1406 Posts |
|
easwar
USA
1965 Posts |
Posted - 01/23/2008 : 10:00:34 AM
|
Hi,
Scripting will provide most flexible solution so one can find files with some wildcard, loop thru all files, create book from template, import file, do any post processing of graphing etc.
There is also one other gui solution if you want to import multiple files and use an existing template: 1> Create the analysis template with your secondary calculation columns and save the template with some desired name 2> Open Import Wizard (menu: File->Import->Import Wizard) 3> Press "..." button for File and select all of your data files in the file dialog that pops up and click "Add Files" and then OK 4> Leave the Import Filter drop-down as "Origin Folder:ASCII" (assuming your file has simple structure - see below) 5> Click on the Template drop-down and select the analysis template that you have created and saved before - so this template will be used to create new book to import each file 6> Change the Import Mode drop-down to "Start New Books"
At this point you can just click OK and each of your selected files will be imported into a new instance of your custom template, which will then have the additional columns. After all files get imported, the auto update will kick in and eventually all cols will get updated - depending on number of files and complexity of calculation, the auto update will take some time to finish.
Now, instead of just clicking OK on this first page of the import wizard, you can also walk thru the wizard to customize your import such as deciding what to do with header lines, how to name columns etc on subsequent pages. And then on the last page of the wizard, you can save your settings to an Import Filter (OIF) file.
The benefit of saving a filter is that once such filter exists, you can in the future even drag and drop multiple files onto Origin and Origin will use the information in the filter, including your custom template etc, to import the files.
Easwar OriginLab
|
 |
|
|
Topic  |
|
|
|