transfer_columns()

transfer_columns()

transfer_columns(db1, db2, remove, *varnames)

Transfers columns between spreadsheets. Replacing db1 or db2 with the empty string “”, will refer instead to the currently open spreadsheet in Datavyu.

Thus, if you want to transfer a column into the GUI, set db2 to ‘’, and specify the origin spreadsheet file as db1. If you want to transfer a column from the GUI into a file, set db1 to ‘’, and set db2 to that file’s path.

Warning

Setting remove to TRUE will DELETE THE COLUMNS YOU ARE TRANSFERRING FROM DB1.

Parameter

Type

Description

db1

String

The full path to save the first Datavyu file. Set to ‘’ to use the spreadsheet that’s currently open.

db2

String

The full path to save the second Datavyu file. Set to ‘’ to use the spreadsheet that’s currently open.

remove

Boolean

If TRUE, Datavyu will delete the columns from db1 as they are copied to db2. FALSE leaves the columns intact.

varnames

list of strings

List of the names of the columns that you wish to copy from db1 to db1. You must specify at least one column name.

Returns

Nothing. Saves files in place or modifies the GUI.

Example

The following example transfers the column “idchange” from test.opf to the GUI and leaves test.opf intact and unmodified.

require 'Datavyu_API.rb'
begin
  sourceFile='/Users/datavyutester/Desktop/FileName1.opf'
  destinationFile='/Users/datavyutester/Desktop/FileName2.opf'
  columnsToTransfer = ['trial_rel', 'condition_rel']
  transferMyVariable(sourceFile, destinationFile, false, columnsToTransfer)
end