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

Hello, I would like to only export a single column from my spreadsheet to Excel. Also, I only need the codes to be exported and not onset/offset times. Is there a simple way I can do this besides exporting the entire spreadsheet? I've tried a couple different scripts, but now I stumped. Thanks!

asked 06 Feb '17, 10:38

kelseyvb's gravatar image

accept rate: 0%


For your task, you will want to create a script with the following contents:

require 'Datavyu_API.rb'

output_file = '~/Desktop/output.csv' # location of output file
column_name = 'my_column' # name of column to export
codes = %w(code01 code02) # list of codes to export

data = []
getVariable(column_name).cells.each do |c|
  row ={ |x| c.get_arg(x) }
  data << row.join(',')

outfile =, 'w+')

I've written this to work on 1.3.4 (to the best of my knowledge). If there are any error messages, you can put them here and I can help fix them.

If you want a different delimiter, feel free to change the filename extension and the argument inside the row.join() command.

permanent link

answered 06 Feb '17, 17:07

Shohan%20Hasan's gravatar image

Shohan Hasan ♦♦
accept rate: 14%

Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 06 Feb '17, 10:38

question was seen: 1,984 times

last updated: 06 Feb '17, 17:07

powered by OSQA