Please use our GitHub Issues page for all new support inquiries. If you need to contact us directly, please e-mail [email protected]

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

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>
permanent link

answered 23 Jul '13, 17:31

WhitneyCole's gravatar image

WhitneyCole ♦
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



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: 23 Jul '13, 17:22

question was seen: 3,402 times

last updated: 23 Jul '13, 17:31

powered by OSQA