
copy and paste values from tables to a new table

daviddoji
I have different tables named as table0, table1, ... with a lot of columns each.
I need to copy values of two columns (but only from a single line) from those tables and to paste these two values into a different table. Of course, I can do it by hand, but I'm wondering if there is a way to do it writing a small macro (maybe a for loop) that I can use in the future.
Thanks a lot.
September 15, 2014 at 05:59 am - Permalink
Sorry for that. Maybe I was not clear enough. Attached you'll find the experiment. In principle, the waves are into different folders, but I can put them into the root folder, no problem for that.
I have different 1D waves organized in different tables (table0, ..., table6). In each of these tables, I need to pick up some values (for example, point0 of the waves 'Ln_RateConv_time' and 'Inv_Temp' from table0, table1, ..., table6) and to add them to two new created waves in a new table, table6 in my example ('Conv_0p1' and 'InvTemp_conv_0p1' in table6).
After that, I need to pick up point1 of the waves 'Ln_RateConv_time' and 'Inv_Temp' from table0, table1, ..., table6 and add them to two new created waves table6, and so on.
Thanks a lot!
September 15, 2014 at 06:18 am - Permalink
If you have not already done it, I highly recommend doing the first half of the Igor guided tour which explains this idea as well as many other important Igor concepts. Choose Help->Getting Started.
Here is a function that accomplishes the specific task that you set out:
That function has very limited utility because it is hard-coded to work with specific waves. Here is a more general function that you can use as a building block to work with any waves:
Here is an example:
If you are not familiar with Igor programming you are going to have to start up the learning curve. To start, execute this:
September 15, 2014 at 10:14 am - Permalink
Thanks hrodstein for your reply,
it solves partially what I'm trying to do. Your procedure only copy the first value of Ln_RateConv_time on both waves, Conv_0p1 and InvTemp_conv_0p1.
I need to copy the first value of Ln_RateConv_time on Conv_0p1 and the first value of Inv_Temp on InvTemp_conv_0p1.
After that, the second value of Ln_RateConv_time should be copied to Conv_0p2 and the second value on Inv_Temp on InvTemp_conv_0p2 and so on. So I think that I will need a for loop to achieve that.
I will try to do it by myself.
September 19, 2014 at 01:57 am - Permalink
September 19, 2014 at 05:01 am - Permalink
Absolutely!!! I'm extremely grateful to you hrodstein again. You're a genius! :D
September 19, 2014 at 05:17 am - Permalink