I'm using ModelBuilder to append a number of shapefiles to a single geodatabase. The shapefiles are located in a folder SHP and the model is designed to iterate through SHP, appending each .shp to the geodatabase. The model enters the name of the file into one of the fields of the geodatabase. Each .shp has very limited information attached to it (field names: FID, Shape, ID).
However, the geodatabase has many fields (Year, Name, Project, Type, etc.), some of which I would like to populate using parts of the filename; the filenames have a specific naming structure, for example: PRJ_YEAR_TYPE.shp, where PRJ is replaced with the name of the project related to the file, and similarly for YEAR and TYPE.
So far, I've been able to add the name of the shapefile to one of the fields of the geodatabase by:
- Adding a Field after I bring in my feature class (.shp) and
- Calculating the Field (named using one of the preexisting fields in the geodatabase), before appending the file to the geodatabase.
However, I'm not able to add mutliple fields. I've tried to duplicate the processes I used to place the filename into the geodatabase name field, but it doesn't seem to work.
How can I add the inforamtion going into the other fields (i.e. (Year, Name, Project, Type, etc.) making reference to the filename?
I am new to ModelBuilder.