Jump to content
  • How to Remove Columns Using Wild Card Characters in Spotfire® using IronPython


    Here is an IronPython scrpting sample to remove certain columns using wild card characters. The code sample allows you to remove all the columns from table "Data Table" with "test" in the column name.

    Introduction

    Here is an IronPython scrpting sample to remove certain columns using wild card characters. In the sample below, you can remove all the columns from table "Data Table" with "test" in the column name.

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    #Finds the index of columns based on search expression, and remove the matched columns
    #See "Searching in TIBCO Spotfire" from the TIBCO Spotfire User's Guide (help file)
    
    import Spotfire.Dxp.Data
    
    myTable = Document.Data.Tables["Data Table"] #"Data Table" is the table where you need to remove columns from
    searchExpression = "*test*" #Put in the wild card characters here
    cols = myTable.Columns
    
    for startCols in cols.FindAll(searchExpression): 
        myTable.Columns.Remove(startCols)
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...