Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

Using multiple wildcard parameters with arcpy.ListFeatureClasses

Add the two together, they are just lists.

FCS = arcpy.ListFeatureClasses("X_*") + arcpy.ListFeatureClasses("*_Y")

To eliminate duplicates:

FCS = set(arcpy.ListFeatureClasses("X_*") + arcpy.ListFeatureClasses("*_Y"))

You could approach it a bit differently:

import arcpy
import os

arcpy.env.workspace = 'c:\temp'
fcs = [fc for fc in arcpy.ListFeatureClasses() if fc.startswith('X_') or os.path.splitext(fc)[0].endswith('_Y')]

Tags:

List

Wildcard

Arcpy

Related

ArcGIS Online and Sign In options greyed out in ArcMap? How to change Leaflet marker color on mouseover? Manually classifying graduated data outside of range in ArcGIS for Desktop? Un-deleting folder accidentally deleted in ArcCatalog? Splitting multi-part polygon into single polygons using ArcGIS Desktop? What are the coordinates of the mysterious hole in Siberia? Hide zoom buttons in ArcGIS Is it possible to use comments in QGIS Query Builder with ESRI shapefiles? Debugging ogr2ogr "AddGeometryColumn failed" and "Terminating translation prematurely after failed translation of layer" What is the source of horizontal and vertical striping in USGS DEMs? Cannot properly import MODIS MOD07_L2 .hdf files into R using rgdal Loop in ModelBuilder for compositing bands of multiple Images

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy