Remove Blank Rows from a Table Showing Text Responses
Jump to navigation
Jump to search
Pages with syntax highlighting errors
Q Technical Reference
Q Technical Reference
Q Technical Reference > Setting Up Data > Creating New Variables
Q Technical Reference > Updating and Automation > JavaScript > Table JavaScript and Plot JavaScript > Table JavaScript and Plot JavaScript Examples Library
The following script can be used to remove blank rows in a table that is showing Raw Data from a Text question.
var num_rows = table.numberRows;
var raw_data = table.get('Text');
for (var j = num_rows - 1; j > -1; j--) {
if (raw_data[j][0] == "")
table.deleteRow(j);
}
See also
- Table JavaScript and Plot JavaScript for an explanation of how to run this code.
- Table JavaScript and Plot JavaScript Reference for technical information.
- Table JavaScript and Plot JavaScript Examples Library for other examples.
- JavaScript for information about the JavaScript programming language.
- QScript for tools for automating projects using JavaScript.
- JavaScript Variables for detail on how to create new variables in the Variables and Questions tab using JavaScript.
Pages with syntax highlighting errors
Q Technical Reference
Q Technical Reference
Q Technical Reference > Setting Up Data > Creating New Variables
Q Technical Reference > Updating and Automation > JavaScript > Table JavaScript and Plot JavaScript > Table JavaScript and Plot JavaScript Examples Library