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.
-
1Welcome to GIS SE! As a new user be sure to take the Tour to learn about our focussed Q&A format. I recommend not thinking about GIS SE as being some sort of online GIS tutor. For your questions to be answered here they should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that.PolyGeo– PolyGeo ♦2016年09月15日 21:42:34 +00:00Commented Sep 15, 2016 at 21:42
1 Answer 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'
Explore related questions
See similar questions with these tags.