Select to view content in your preferred language

Need help on Desktop ModelBuilder

948
3
05-03-2012 02:36 PM
johnsmith4
New Contributor
I am trying to create a batch processing model by using ModelBuilder. The model I want to create is for generating Point shape files by using *.txt files. In the text file, it has X,Y and several other fields such as: Name,ID etc.

So far I have reached in ModelBuilder as: load txt file -> Make XY Event -> Feature To Point -> Points to Line -> Feature To Polygon, for only one file at a time.

Now I have two question:
1. I have more then 100 txt files need to load and how to make this automatically?
2. How to keep the "NAME" & "ID" attribute information from txt file in final polygon? Right now I can have the final Polygon has all field columns kept but all fields are empty.

Thanks...
Tags (2)
0 Kudos
3 Replies
JonathanQuinn
Esri Notable Contributor
Take a look at the Iterators for ModelBuilder.  The one you're looking for is the Iterate Files iterator, and you can specify to only look for .txt files.  It will iterate through each file to use in the rest of the model.  Once it's done with that one .txt file, it should jump to the next one in line, and run through the model.
0 Kudos
Ann123
by
Occasional Contributor
I have a similar problem - but I am trying to add 8 new fields to an existing geodatabase.  I can use the Add Field tool, but then can I use the Iterate Files interator for the inputs for the Add Field tool?  <I'm extremely new to ModelBuilder so as specific as possible is helpful!>.
0 Kudos
MichaelVolz
Esteemed Contributor
I would look to use python for the iteration.  You can create the basic one time model and then export the model to a python script.

You can then call the python script from a scheduled task or you can call a bat file that calls a python script from a scheduled task.  The bat file is especially useful if you want to run more than one python script in a sequence.
0 Kudos