T O P I C R E V I E W |
ghuoof |
Posted - 11/06/2015 : 05:56:49 AM Origin Ver. and Service Release: 9.0.0 SR2 Operating System: Win 7 32 bit
Hi,
I want to write an import script which will duplicate the sheet and transpose it basically. I want the first column to come from the comments.
I have gotten as far as duplicating the sheet...
worksheet -dr transposed; //duplicate sheet and make it active
simple things like this don't seem to do anything:
wks.insertRows(1);
but others do:
col(B)[L]$ = "TEST";
help? |
7 L A T E S T R E P L I E S (Newest First) |
jasonzhao |
Posted - 11/12/2015 : 04:54:33 AM Thanks for the comment. We will add some examples.
One thing that might help you in programming is that we can generate script from the dialog. For example, in this case, you can
1. Choose menu Worksheet: Transpose (or run "wtranspose -d") 2. In the opened dialog, set setting as you want 3. Click on the triangle button next to the Dialog Theme and choose Generate Script from the context menu -->The script for using the settings in the dialog will be output to the Script Window, then you can use it in your programming
Best regards! Jason OriginLab Technical Service |
ghuoof |
Posted - 11/11/2015 : 04:51:51 AM Thanks Jason, that works perfectly. Thanks for your help and quick replies.
I just wanted to say that I think origin is great and really powerful but the documentation is quite confusing. Having a few more examples would be quite helpful. I have a bit of programming experience but I don't think I would have figured out how to use wtranspose correctly from reading this description of col:=first:
"Exchanges the first data column with the selected column label row with X column designation. The Label Type cannot be Sample Rate. Note: the leftmost cell of the column label row will be excluded in the exchange." |
jasonzhao |
Posted - 11/11/2015 : 03:57:52 AM Hello,
To use the 1st column as the comment after transpose, plese try the script below:
wtranspose type:=comment col:=first ow:=<new>;
Best regards! Jason OriginLab Technical Service |
ghuoof |
Posted - 11/10/2015 : 4:39:16 PM Thanks! That works, it's almost what I want. Can I likewise have the first column transposed to the comments somehow? |
jasonzhao |
Posted - 11/10/2015 : 04:26:39 AM Hello,
You can use the wtranspose X-function to transpose the worksheet with 'Comment' row. http://www.originlab.com/doc/X-Function/ref/wtranspose
For example, you can active the sheet, and run the Script:
wtranspose type:=comment ow:=<new>;
Then, new created transposed sheet will use comments as 1st column.
Best regards! Jason OriginLab Technical Service |
ghuoof |
Posted - 11/10/2015 : 03:58:35 AM Right, thanks.
I think I did a poor job of explaining what I want to do. I already have an import filter set up but I want each file I import to create two sheets or books. One which will be a transpose of the other. The comments row from the non-transposed sheet should be part of that block that gets transposed, if that makes any sense. So it should become a column and vice versa.
quote: Originally posted by jasonzhao
Hello,
You can define an import Theme with name 'Userdef', which specifies using which column as the 'Comment';
Then, we apply this theme in the LabTalk Script:
string fn$=system.path.program$ + "Samples\Curve Fitting\Ellipse.dat";
impasc fname:=fn$ -t "Userdef";
Best regards! Jason OriginLab Technical Service
|
jasonzhao |
Posted - 11/08/2015 : 8:48:37 PM Hello,
You can define an import Theme with name 'Userdef', which specifies using which column as the 'Comment';
Then, we apply this theme in the LabTalk Script:
string fn$=system.path.program$ + "Samples\Curve Fitting\Ellipse.dat";
impasc fname:=fn$ -t "Userdef";
Best regards! Jason OriginLab Technical Service |