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
 Few question
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Neytan

5 Posts

Posted - 11/19/2014 :  09:47:05 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Good time to everyone!

Please, help with a few very simple for many of you question:
1) How could i multiply 2 column (B) from 2 other workbooks OR worksheets? OR better - how multiply all graphs (on 1 graph layer) on my important book with col(B)?
2) How could i delete special rows (comments, sparklines, etc.) and a first 5 and last 5 rows (full numbers of rows - 305)?

Thank you
Alex

Edited by - Neytan on 11/19/2014 09:49:09 AM

jasonzhao

China
262 Posts

Posted - 11/19/2014 :  10:38:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Please try the script below:

the script plus all datasets in book1 with book2_A, save results in boo2_A


win -a book1;// active book1

doc -e d  // loop through all dataset in active sheet
{
Book2_A*=%C;  //%C contained name of each data set;
%C=;
}



You can refer to this page for row delete:

http://www.originlab.com/doc/LabTalk/ref/Delete-cmd

Best regards,
Jason Zhao
OriginLab Tech Service

Edited by - jasonzhao on 11/19/2014 11:26:15 PM
Go to Top of Page

Neytan

5 Posts

Posted - 11/20/2014 :  05:44:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by jasonzhao

Hello,

Please try the script below:

the script plus all datasets in book1 with book2_A, save results in boo2_A


win -a book1;// active book1

doc -e d  // loop through all dataset in active sheet
{
Book2_A*=%C;  //%C contained name of each data set;
%C=;
}



You can refer to this page for row delete:

http://www.originlab.com/doc/LabTalk/ref/Delete-cmd

Best regards,
Jason Zhao
OriginLab Tech Service


Hello,
Thank you for reply!

Unfortunately, its not what i want.
*I have 2 different workbooks (book1 and 2) (or 1 book (book1) with 2 worksheets). These workbooks (or worksheets) incleed 2 column (A and B).
And i have one more workbook (for simple - book3 with 2 column) with important sens. I want multiply column B in first 2 workbooks (or 1 workbooks with 2 worksheets) at column B in workbook workbook with sens. I could do it with "Simple math", but i want it "in one click".
Book1_b*Book3_b, Book2_b*Book3_b.

*Thanks for the link, but i (whatever) dont understand how could i del special row.
Im knowing how del simple row:
|range ra = [%(page.name$)]%(layer.name$)![1]:[13];
del ra;|.

Alex


____________________
Add one more question:
How change a color of plots in these script?

"doc -e LB
{
plotxy iy:=(1,2) plot:=200 ogl:=[Graph1]1!;
layer.x.from = 1.1;
layer.x.to = 1.6;
layer.x.inc = 0.05;
layer.y.from = 0;
layer.y.to = 3000;
layer.y.inc = 300;
}"

Thanks

Edited by - Neytan on 11/20/2014 11:28:14 AM
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 11/21/2014 :  02:07:51 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

As you pointed out, the loop object is each book, so I modify the script,which excute the operation
Book1_b*Book3_b, then Book2_b*Book3_b. the result saved in book3_b

win -a book1;// active book1

doc -e w // loop through all book in project
{
book3_B*=[%H_B]; //%H contained name of each book set;
%H_B=;
}

book3_B=sqrt(book3_B); // devided by itself


As for the comments row, please refer to this page:
http://www.originlab.com/doc/LabTalk/guide/Accessing-Metadata

and try to active the sheet, use script below to hide the comment row:


range ww = !;
ww.labels(LU);


Besides, you can set the line color in this way:

plotxy iy:=(1,2) plot:=200 color:=color(0,49,83); //set RGB color


Best regards,
Jason Zhao
OriginLab Tech Service

Edited by - jasonzhao on 11/21/2014 02:22:12 AM
Go to Top of Page

Neytan

5 Posts

Posted - 11/21/2014 :  08:05:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by jasonzhao

Hello,

As you pointed out, the loop object is each book, so I modify the script,which excute the operation
Book1_b*Book3_b, then Book2_b*Book3_b. the result saved in book3_b

win -a book1;// active book1

doc -e w // loop through all book in project
{
book3_B*=[%H_B]; //%H contained name of each book set;
%H_B=;
}

book3_B=sqrt(book3_B); // devided by itself


As for the comments row, please refer to this page:
http://www.originlab.com/doc/LabTalk/guide/Accessing-Metadata

and try to active the sheet, use script below to hide the comment row:


range ww = !;
ww.labels(LU);


Besides, you can set the line color in this way:

plotxy iy:=(1,2) plot:=200 color:=color(0,49,83); //set RGB color


Best regards,
Jason Zhao
OriginLab Tech Service



Thank you for your reply.

*Thanks for special row's hide code! :) (but would better if removing)

*BUT Unfortunately all graphs drawing by one color. If I have 5-10 graphs Im wanting 5-10 different colors for these graphs. All plots on 1 graph layer . How could I do it?

*And about multiply... Its not that i want. I need these:
[GalogenLampSi_B]=[GalogenLampSi_B]*[GeSens_B]
[GalogenLamp1_B]=[GalogenLamp1_B]*[GeSens_B]
[GalogenLamp(etc.)_B]=[GalogenLamp(etc.)_B]*[GeSens_B]

*How could I change height of sparklines without attention window and change legend labels (Name of file + my comments)?

Alex

Edited by - Neytan on 11/21/2014 08:14:39 AM
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 11/23/2014 :  9:52:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello, please see the answers list below:


  1. Please try the script for multiply:

    
    doc -e w // loop through all book in project
    {
    [%H_B]*=GeSens_B; //%H contained name of each book set;
    [%H_B]=;
    };
    
    GeSens_B=sqrt(GeSens_B);
    


  2. For color changing follows the "Increment" you can use the script below:

    
    int i=2;
    
    doc -e d{
    
    set %C -c $(i);
    i++;
    
    }
    

    However, the Edit Mode in Group tab in Plot Details(Plot Properties) dialog should be independent.


  3. As for sparklines settings, please run this commend, and refer to page http://www.originlab.com/doc/X-Function/ref/sparklines:
    
    sparklines -d;
    




Best regards,
Jason Zhao
OriginLab Tech Service
Go to Top of Page

Neytan

5 Posts

Posted - 12/03/2014 :  03:53:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by jasonzhao

Hello, please see the answers list below:


  1. Please try the script for multiply:

    
    doc -e w // loop through all book in project
    {
    [%H_B]*=GeSens_B; //%H contained name of each book set;
    [%H_B]=;
    };
    
    GeSens_B=sqrt(GeSens_B);
    


  2. For color changing follows the "Increment" you can use the script below:

    
    int i=2;
    
    doc -e d{
    
    set %C -c $(i);
    i++;
    
    }
    

    However, the Edit Mode in Group tab in Plot Details(Plot Properties) dialog should be independent.


  3. As for sparklines settings, please run this commend, and refer to page http://www.originlab.com/doc/X-Function/ref/sparklines:
    
    sparklines -d;
    




Best regards,
Jason Zhao
OriginLab Tech Service



Good time!)
Thank you, so much! All working! And im very happy!)

But, if I want "division operation" instead of "multiplication", column "GeSens_B" divided on itself. Why? How could i save this column "GeSens_B"?

And one more:
If I have 6 workbooks (2 cols) and want to plot only 5. How could i do that? PS I know workbook name which should not plot. (Book2,3,...,Testbook)

Edited by - Neytan on 12/03/2014 04:07:36 AM
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 12/14/2014 :  08:16:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

You can use a if statement to pass the specific object.
eg:

doc -e LB
{
if(%H!="Book1")     //if you don't want to plot Book1       
plotxy iy:=(1,2) plot:=200;
}


doc -e w // loop through all book in project
{
if(%H!="GeSens")   //if you don't want to devide BeSens_B
[%H_B]/=GeSens_B; //%H contained name of each book set;
[%H_B]=;
}


Best regards,
Jason Zhao
OriginLab Tech Service
Go to Top of Page

Neytan

5 Posts

Posted - 12/19/2014 :  07:12:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by jasonzhao

Hello,

You can use a if statement to pass the specific object.
eg:

doc -e LB
{
if(%H!="Book1")     //if you don't want to plot Book1       
plotxy iy:=(1,2) plot:=200;
}


doc -e w // loop through all book in project
{
if(%H!="GeSens")   //if you don't want to devide BeSens_B
[%H_B]/=GeSens_B; //%H contained name of each book set;
[%H_B]=;
}


Best regards,
Jason Zhao
OriginLab Tech Service



Hi! Thank you for your reply!

I could't have done with my work without your help! Thank you so much, jasonzhao!

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