Export table using field alias as name, remove join table name from field name

8369
5
04-25-2011 01:07 PM
MarkVolz
Occasional Contributor III
Hello,

I am joining a table to a layer in Model Builder, then exporting the layer to a new feature class.  When I join, then export the data all of my fields are renamed to SourceTableName.FieldName.  I would rather that the fields in the exported feature class not include the name of the source table.

Here is an example of the current fields:

TaxData.PIN
OwnerData.Owner

Desired:

PIN
Owner


*************************
Solutions:

1) Go through "add field, and calculate field" for each of my fields (about 30 in total).  This solution is very unfriendly

**************************

How can I instead:

1) rename fields in the geodatabase via model builder?
2) have ArcMap / ArcCatalog not rename fields to table.field when joining data?
3) when exporting the feature class use the alias as the names of the field on the export?
5 Replies
MarkVolz
Occasional Contributor III
FYI

Feature Class to Feature Class allows you to rename all the fields in a single step in Model Builder.  I still had to go through and rename all the fields from tablename.fieldname to fieldname.  But at least I was able to complete the process in a single step on model builder.
0 Kudos
LledSmith
New Contributor III
well this won't work if you have 200 fields to rename.  I did this by selecting all the records in table view>right click one of the little squares on the way left>copy selected> paste in to excel>  do what ever you after this
0 Kudos
StephenAldrich
New Contributor II

So I was struggling with this recently and... decided to go low-tech. I exported my large table with good aliases and terrible field names to CSV, opened it in notepad (yeah, it took awhile) and then used the "replace" function (CTRL+H) to get rid of the offensive field titles. Worked like a charm!

0 Kudos
JohnSobetzer
Frequent Contributor

If you use the add join tool and go into Environment Settings - Fields and uncheck Maintain Fully Qualified Field Names do you then get what you want?

0 Kudos
alex_friant
Occasional Contributor II

ArcGIS Pro has a nice tool called "Table to Excel" which allows you to export to an .XLS (if your table has less than 65535 records) or .XLSX, and it allows you to click a checkbox that states "Use field alias as column header". However, that checkbox is referring to the field alias registered with the feature class, not the table inside the map, as you see it. So, if you can use the field aliases as they are set in the feature class, that's a great tool to use. But if you've modified the field aliases in the table in your map, and then want those new ones, this tool won't work.

However, if you're dataset isn't too large, you can still select all records, copy them, and then paste them directly into Excel. That preserves the alias column names you customized, as you see them in the map table.

TL;DR: You can use Pro's "Table to Excel" tool, -OR- you can just select all records, and copy/paste directly into Excel from Pro.