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

How do I use a script to delete cells from a variable?

asked 04 Oct '11, 09:01

KariKretch's gravatar image

accept rate: 0%

edited 23 Jul '12, 09:40

Clinton's gravatar image


All of the cells for a column are stored in the "cells" array of that column. The best way to delete them is to match the cells you want with some if statement, then just use the Ruby Array argument "delete" to delete them.

For example, say I had a column called "trial" that had an argument called "hand", that could be "l" or "r" (meaning left or right hand). For some reason, I want to delete all of the cells that were coded as a left hand.

# First get the column from the database
trial = getVariable("trial")

# Now loop through all of the cells in that column, checking if
# they are coded as a left hand.
for cell in trial.cells
   # Is hand coded as "l" for this cell?
   if cell.hand == "l"
      # If yes, then delete it from the cell array.
permanent link

answered 26 Jan '12, 09:07

Jesse's gravatar image

Jesse ♦
accept rate: 53%

permanent link

answered 30 Mar '17, 10:52

andrei's gravatar image

accept rate: 0%

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: 04 Oct '11, 09:01

question was seen: 6,576 times

last updated: 30 Mar '17, 10:52

powered by OSQA