Announcing the new Datavyu v1.3.6 with enhanced features and transcription support!

How do you make a spreadsheet that you can use as a default template? - i.e., I have multiple videos files, I need to code each individually, but I want to use the same set of codes for each.

Thank you!

asked 02 Apr '15, 15:54

CCDLabRA's gravatar image

CCDLabRA
16112
accept rate: 0%


The easiest way to set up a template spreadsheet is to add all your column and codes to a new spreadsheet and then save it naming it "TemplateSpreadsheet." When you begin coding a new participant, open the template spreadsheet, save it as S#1 or whatever naming scheme you use, and then begin coding.

Be careful not to overwrite your template spreadsheet by saving it with codes in it. Always keep that spreadsheet blank so you can start coding from scratch without having to constantly adding the codes through the code editor.

permanent link

answered 02 Apr '15, 16:01

Vicky%20Foo's gravatar image

Vicky Foo ♦♦
237557
accept rate: 1%

Additionally, if you are comfortable setting up and using scripts you can use a script to add the columns and codes. Here's an example script to add 3 columns (id, task, and trial):


require 'Datavyu_API.rb'
########################################
##############  PARAMS  ################
# Column-arg mappings. This is an associative array that pairs the name of the column
# to a list of codes to add to that column.  All codes on the righthand side of each mapping should
# be inside the brackets [] and separated by commas.
myMap = {
    'id' => ['id_number','exp_date','birth_date','sex_mf'],
    'task' => ['condition_xyz'],
    'trial' => ['trial_num','result_yn']
}

# If replace is set to true, any existing columns with the same names will be replaced
# with a blank new column.  YOU CAN NOT UNDO THIS.  When false, only appends argnames
# that are new.
replace = false
verbose = 1

##############  MAIN ROUTINE  ################
begin
    varList = getVariableList()

    columnsAdded = 0
    myMap.each_pair{
        |colname,argnames|
        if not replace and varList.include?(colname)
            puts "#{colname} already exists. Checking for codes to add." if verbose > 0
            col = getVariable(colname)
            newargs = argnames - col.arglist
            newargs.each{ |narg| col.add_arg(narg) }
        else
            puts "Adding column #{colname}" if verbose > 0
            columnsAdded+=1
            col = createVariable(colname,*argnames)
        end
        setVariable(col)
    }

    puts "Finished.  Added  #{columnsAdded} new column(s)." if verbose > 0
rescue StandardError => e
    puts e.message
    puts e.backtrace
end
permanent link

answered 02 Apr '15, 18:48

Shohan%20Hasan's gravatar image

Shohan Hasan ♦♦
381126
accept rate: 12%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×11

question asked: 02 Apr '15, 15:54

question was seen: 3,332 times

last updated: 02 Apr '15, 18:48

powered by OSQA