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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 copy row value

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
kdsaransh Posted - 01/14/2017 : 01:22:26 AM
Hi i am using origin 9.1.

I want to copy row 294 and col D and E value. I also want to copy row 236 and col E value.

Now i want to place these values into another new workbook in particular sequence. The value of row 236 and col E should go into 1st col of this new workbook and the value row 294 and col D and E to col 2 and 3 respectively of this new workbook.

And i have many workbooks and i want to do the same operation for all. That is, the next value should come below the first value and so on.

Any help...

Thanks

Rajesh Agarwal
5   L A T E S T    R E P L I E S    (Newest First)
Neonly Posted - 02/03/2017 : 03:33:13 AM
quote:
Originally posted by kdsaransh

Hi,
Thanks for the repkly,

But I has more than 1000 workbooks with different names.



Smarter choice to write a script than to do it manually when you have some many spreadsheets of data to analyze.



Jonas
kdsaransh Posted - 01/16/2017 : 07:40:09 AM
Thanks a lot.

Regards,
Rajesh Agarwal
cpyang Posted - 01/16/2017 : 06:20:54 AM
I don't see any Range notation direct assignment as I had pointed out. There is no need to use wrcopy, just define the range variable for the data column and make assignments.

CP
kdsaransh Posted - 01/16/2017 : 01:09:04 AM
Hi,
Thanks for the repkly,

But I has more than 1000 workbooks with different names.

my code looks like:

newbook name:="Charge Pump" sheet:=1;
Col(1)[L]$="Frequency";
Col(2)[L]$="ITotalavg_Drain";
Col(1)[U]$="Hz";
Col(3)[L]$="abs ID";
Col(4)[L]$="Normalised ID";

Col(5)[L]$="ITotalavg_Source";
Col(6)[L]$="abs IS";
Col(7)[L]$="Normalised IS";

csetvalue col:=[Charge Pump]Sheet1!col(3) formula:="abs(col(b))" recalculate:=1;
csetvalue col:=[Charge Pump]Sheet1!col(4) formula:="col(c)/4.45966e-9" recalculate:=1;

csetvalue col:=[Charge Pump]Sheet1!col(6) formula:="abs(col(e))" recalculate:=1;
csetvalue col:=[Charge Pump]Sheet1!col(7) formula:="col(f)/4.45966e-9" recalculate:=1;

Int n= 100;
ii = 1;
for(int ii = 1; ii<=n; ii++)
{

wrcopy iw:=[ResultBook]1! r1:=ii r2:=ii c1:=7 c2:=7 dr1:=ii dc1:=1 ow:=[Charge Pump]1!;
wrcopy iw:=[ResultBook]1! r1:=ii r2:=ii c1:=4 c2:=4 dr1:=ii dc1:=2 ow:=[Charge Pump]1!;
wrcopy iw:=[ResultBook]1! r1:=ii r2:=ii c1:=5 c2:=5 dr1:=ii dc1:=5 ow:=[Charge Pump]1!;

}

// plot Charge Pump vs Frequency
plotxy iy:= [Charge Pump]Sheet1!(1,2) ogl:=[<new template:="C:\Users\Babia-pc\Documents\OriginLab\91\User Files\Averageexp.otp" name:=samplegraph>];
page.longname$="Charge Pump VS Frequency"; // change the graph name.

layer -a;

legend.color=2; // make the legend colour red ( 2 is the index color of red)

legend.text$ = "\b(%(legend.text$))";// ( make the legend text bold)

plotxy iy:= [Charge Pump]Sheet1!(1,5) ogl:=[<new template:="C:\Users\Babia-pc\Documents\OriginLab\91\User Files\Averageexp.otp" name:=samplegraph>];
page.longname$="Charge Pump VS Frequency2"; // change the graph name.

layer -a;

legend.color=4; // make the legend colour red ( 4 is the index color of blue)

legend.text$ = "\b(%(legend.text$))";// ( make the legend text bold)

range q=[ResultBook];// now delete the result book.
del q;


I am not getting the value of the frequency in col 1 of the charge pump sheet.
cpyang Posted - 01/15/2017 : 2:45:47 PM
Simplest way to do this is to write a simple LabTalk script. You can begin by reading about Range notation in LabTalk:

http://www.originlab.com/doc/LabTalk/Tutorials/Tutorial-Range-Notation

Code will look something like this


range sd = [book1]1!col(d);
range se = [book1]1!col(e);
range dest1=[book2]1!wcol(1);
range dest2=[book2]1!wcol(2);

int nr = 294;
dest1[1]=sd[nr];
dest1[2]=se[nr];


CP

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000