How can I export selected records to a new file using Model Builder

3538
12
Jump to solution
10-31-2017 10:36 AM
lindatomaselli
New Contributor III

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?

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

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.

View solution in original post

12 Replies
DanPatterson_Retired
MVP Emeritus

use Copy Features to save your selected output to a new featureclass

lindatomaselli
New Contributor III

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?

0 Kudos
DanPatterson_Retired
MVP Emeritus

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.

lindatomaselli
New Contributor III

OK. I saw copy rows, and I tried using it, but I will try again. Thanks for your feedback.

0 Kudos
curtvprice
MVP Esteemed Contributor

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.

lindatomaselli
New Contributor III

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!

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

0 Kudos
DanPatterson_Retired
MVP Emeritus

glad it worked out

0 Kudos
lindatomaselli
New Contributor III

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.

0 Kudos
curtvprice
MVP Esteemed Contributor

Linda, environment variables can be set at many levels - application, model, model tool. You can set it by-tool inside model builder with right click the tool > Properties > Environments tab.

Environment levels and hierarchy—Help | ArcGIS Desktop 

0 Kudos