I'm trying to use the modelbuilder to convert some feature classes to rasters using iterators. The names on each feature class contains year_xxxx with xxxx being an extension number that I don't want my output raster names to have. For example: 1845_6002pt.sh as input and I want 1845 only in the output.

  • 1

How do you want to do this? Do you have any python knowledge? Add more detail to your question if you would like a detailed answer.

Here is a python snippet to split a string:

yourstring = "1845_6002pt.sh"
return yourstring.split('_')[0]

This will return '1845'

Your Answer

