0

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.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Sep 15, 2016 at 21:36
1
  • 1
    Welcome 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. Commented Sep 15, 2016 at 21:42

1 Answer 1

2

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'

answered Sep 19, 2016 at 5:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.