Eliminating empty values from csv file

PennController for IBEX Forums Support Eliminating empty values from csv file

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9716
    olivia
    Participant

    Hello Jeremy,

    I am working on an audio-text matching experiment and I wonder if there is a way to check whether the content at a csv cell is an empty string. For instance, when the experiment creates a button, it can maybe use an if statement or some other inner functions to check whether the content at audio13 is “”, and if so, the button will not be created.

    Here is the link to the demo: https://farm.pcibex.net/r/MrsHBC/.

    Thank you so much for your help!

    #9718
    Jeremy
    Keymaster

    Hello,

    Yes, you can use the javascript ternary conditional operator:

    ...( row.audio13.length>0 ? [
      newAudio("audio13", row.audio13)
      ,
      newButton("(Re)play audio13")
          .callback(
              getAudio("audio13")
              .play()
          )
          .print()
    ] : [] )
    

    Jeremy

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.