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

I want to perform an operation (through a script) on a column that is included in only some of my files. So I need to first check whether the variable exists in the file and then run the operation if it does exist. Is there a way to access a list of all the variables/columns in an OpenSHAPA file through the scripting API?

asked 23 Jul '13, 17:22

KariKretch's gravatar image

KariKretch
31224
accept rate: 0%


Yes, there is. First you need to get the column list (just as you would normally get a variable at the beginning of a script):

columns = getColumnList()

Now that you have the column list, it's easy to check if it includes your variable:

if columns.include?("variable name")
     <insert whatever it is you want to do here>
end
permanent link

answered 23 Jul '13, 17:31

WhitneyCole's gravatar image

WhitneyCole ♦
417239
accept rate: 21%

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:

×18

question asked: 23 Jul '13, 17:22

question was seen: 2,089 times

last updated: 23 Jul '13, 17:31

powered by OSQA