Filter data for excel by 'part of the name'

Hi there!

I’m trying to get some data from Revit schedules to Excel, filtered on a specific part of the name.

For example:
I start with the following;
List
[0] 13.20_BID_FL_tpg_beton_300_C35/45_constr
[1] 27.21_BID_FL_tpg_beton_300_C35/45_constr_vlak
[2] 23.21_BID_FL_kanaalplaat A260_C45/55_constr_vrijdr
[3] 23.21_BID_FL_breedplaat_260_C35/45_constr_vrijdr

I would like to filter them on the word ‘tpg’, so my result would be:
List [0]
[0] 13.20_BID_FL_tpgbeton_300_C35/45_constr
[1] 27.21_BID_FL
tpg_beton_300_C35/45_constr_vlak

List [1]
[0] 23.21_BID_FL_kanaalplaat A260_C45/55_constr_vrijdr
[1] 23.21_BID_FL_breedplaat_260_C35/45_constr_vrijdr

This is what I have so far, as you can see it isn’t working out… I’m sure it is because I used the equal node the wrong way, but I simply don’t know how to dive into this any other way. Can anyone help me out with this? Thanks!

Use String.Contains instead of ==

Thanks!!

How would l alter my script to pass multiple applicable schedules through the Python Script.

I am trying to hide multiple applicable schedule columns of a given name.

The single entry works, as provided by someone via this forum, however, l cannot work out how to introduce multiple applicable entries into the script.

I applied this, which l found on here, but returned evaluator issue:

import clr
clr.AddReference(‘RevitAPI’)
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)
from Revit.Elements import *
clr.ImportExtensions(Revit.GeometryConversion)
from Revit.GeometryConversion import *
clr.ImportExtensions(Revit.GeometryReferences)
from Revit.GeometryReferences import *
import System
from System.Collections.Generic import *

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import *
#TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
uiapp=DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

view = doc.ActiveView

def U(elem):
a = UnwrapElement(elem)
return a

colName = “Material: Volume”;
S = UnwrapElement(IN[0])

for schedule in S:
[definit = schedule.Definition
countParameters = definit.GetFieldCount()

Parameter names

names = []
for i in range(countParameters):
	Parname = definit.GetField(i).ColumnHeading # Parameter Column name
	if Parname == colName:
		index = i

field = schedule.Definition.GetField(index) # schedule field

TransactionManager.Instance.EnsureInTransaction(doc)
field.IsHidden = IN[1] # 1 = Hide, 0 = Show
TransactionManager.Instance.TransactionTaskDone()
]

OUT = schedule