I have a file of all the census blocks in Illinois. After selecting only the records that I want, how can I export them as a new file in Model Builder?
I didn't see 'just the table' part... which in this case would mean use Copy Rows and if there are any other preconditions on what rows to include or exclude, then that has to be dealt with first.
use Copy Features to save your selected output to a new featureclass
Copy Features only works if the file is a shapefile, not a dbf. Furthermore, even if I join the block data to the block shapefile, the result of Copy Features has fields like "original1", "original2" from my block shapefile......and then "il_pop1", il_pop2" from the joined. So I would have a big problem with my field names.
If I join my block shapefile to the Illinois data and select only the records that match, if I just use Copy, it copies all the Illinois records and does not include the joined records.
Does this mean that I can only interactively use Export to get the desired result rather than being able to do it in a model?
OK. I saw copy rows, and I tried using it, but I will try again. Thanks for your feedback.
I would get away from shapefiles, and try file geodatabase... the 10-character field limit is going to make the output field names really hard to interpret. You may want to turn off the environment setting Qualified Field Names to minimize the field renaming.
Yes, I was able to join my local block file to the state block file and select the records that I want. If I remove the join, I can use Copy Rows to save the selected records.
However, in cases where I have joined 2 dbf files and want to export them to another file, the field names are changed, just as in Copy Features. If I interactively use Export, the field names are preserved.
My rhetorical question is, why is there no Export function among the tools?
Thanks for your help again. At least you solved part of my problem.
Dr. Linda Tomaselli, GISRDC
341 Jamaica Way
Niceville, FL 32578
(850) 687-6459 or (850) 897-2012
<mailto:Ltomaselli@GISRDC.com> Ltomaselli@GISRDC.com or <mailto:Ltomaselli@Earthlink.net> Ltomaselli@Earthlink.net
OK Dan!
The secret was in the environment settings, as you suggested.
This seems like such a basic function, yet it took a long amount of time to find the answers.
I am very grateful.
THANKS!
Dan:
Another note. Copy Rows shows the environment options when you are just using the tool out of the toolbox. When it is inserted into a model, the Environment option disappears. But if you enter the file names and then save the model and then double click on it, one can set the environment that way.
Again, thanks for your help.
Another “discovery”. While one can set the environment for the fields in the model, the setting is not preserved in the model if it is run again. I found that I must go to Geoprocessing > environments to set it to be constant for all my models that need to preserve the field names. I am sure you knew this, but I am just documenting it “for the record”.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.