Skip to content

delete_cells script not working #424

Description

@Ye-1993

** Existing script **
Hello hello - thanks for reading my post.
delete_cells function does not work for me.

** Description **

I need to delete all cells in a column (named speech) that contain "b" in a specific code (named source).

speech
(source, content)
For instance: (b, hello)

I adjusted my codes according to the post (https://datavyu.org/user-guide/api/reference/1.3.4/deleteCell.html)

Here are my codes:
`require 'Datavyu_API.rb'
trial = get_column("speech") # First get the column from the database

for trial_cell in trial.cells # Now loop through all of the cells in that column, checking if source contains "b"
if trial_cell.source == 'b' # Is source coded as "b" for this cell?
delete_cell(cell)
end
end`

The script keeps on showing the following errors, no matter how I changed the name of codes.
See line 11 of C:\datavyu_files\Delete-CellsTry.rb: delete_cell(cell) See line 8 of C:\datavyu_files\Delete-CellsTry.rb: for trial_cell in trial.cells

Thank you very much for your time to reply!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions